A = 
      4  x^6 + 3  x^5 + x^4 + 7  x^3 + 6  x^2 + 2  x + 
        4
n = Exponent[A, x]
p = 13
lcoeff = Coefficient[A, x, n]

reste = 
      Table[PolynomialMod[PolynomialRemainder[(x^i)^p, A, x], 
          p], 
{i, 0, n - 1}]

CoefficientList[(∑_(k = 0)^(n - 1))(Subscript[β, k]) (reste[[k + 1]] - (x^k)), x]

sol = 
      Solve[Union[
          Map[# == 0 &, 
            CoefficientList[
              Sum[(Subscript[β, k]) (reste[[k + 1]] - (x^k)), {k, 0, 
                  n - 1}], x]], {Modulus == p}], 
        Table[(Subscript[β, k]), {k, 0, n - 1}]]

b = 
      PolynomialMod[(∑_(k = 0)^(n - 1))(Subscript[β, k]) (x^k) /. 
            sol[[1]] /. (Subscript[β, l])_ -> 1, p]

tab = 
      Table[PolynomialGCD[A, b - k, Modulus -> p], {k, 0, 
          p - 1}]

lcoeff Apply[Times, tab]

\(	\)

Factor[A, Modulus -> p]