f = x^4 + 6*x^2 - 3*x - 6;\

for(a=1,5,for(b=-5,5,if(gcd(a,b)==1,m=abs(a^4*subst(f,x,b/a));\
if(a==1,print("f(",b,") = ",factor(m)),print(a,"^4*f(",b/a,"): ",factor(m))),)))

f(-5) = [2, 4; 7, 2]
f(-4) = [2, 1; 179, 1]
f(-3) = [2, 1; 3, 1; 23, 1]
f(-2) = [2, 3; 5, 1]
f(-1) = Mat([2, 2])
f(0) = [2, 1; 3, 1]
f(1) = Mat([2, 1])
f(2) = [2, 2; 7, 1]
f(3) = [2, 3; 3, 1; 5, 1]
f(4) = [2, 1; 167, 1]
f(5) = [2, 1; 13, 1; 29, 1]
2^4*f(-5/2): Mat([1249, 1])
2^4*f(-3/2): [3, 1; 7, 1; 13, 1]
2^4*f(-1/2): Mat([47, 1])
2^4*f(1/2): [5, 1; 19, 1]
2^4*f(3/2): [3, 1; 43, 1]
2^4*f(5/2): Mat([1009, 1])
3^4*f(-5/3): [2, 1; 947, 1]
3^4*f(-4/3): [2, 1; 479, 1]
3^4*f(-2/3): [2, 2; 23, 1]
3^4*f(-1/3): [2, 1; 5, 2; 7, 1]
3^4*f(1/3): Mat([2, 9])
3^4*f(2/3): [2, 5; 13, 1]
3^4*f(4/3): [2, 1; 5, 1; 31, 1]
3^4*f(5/3): [2, 2; 271, 1]
4^4*f(-5/4): [31, 1; 79, 1]
4^4*f(-3/4): [3, 1; 5, 1]
4^4*f(-1/4): [29, 1; 43, 1]
4^4*f(1/4): [7, 1; 233, 1]
4^4*f(3/4): [3, 1; 389, 1]
4^4*f(5/4): Mat([23, 2])
5^4*f(-4/5): [2, 1; 7, 1; 29, 1]
5^4*f(-3/5): [2, 1; 3, 1; 199, 1]
5^4*f(-2/5): [2, 4; 149, 1]
5^4*f(-1/5): [2, 3; 13, 1; 31, 1]
5^4*f(1/5): [2, 1; 1987, 1]
5^4*f(2/5): [2, 2; 971, 1]
5^4*f(3/5): [2, 2; 3, 1; 7, 1; 41, 1]
5^4*f(4/5): [2, 1; 1297, 1]

for(p=2,73,if(isprime(p),print([p,lift(factormod(f,p))]),)) 
                                                                      
[2, [x, 1; x + 1, 1; x^2 + x + 1, 1]]
[3, Mat([x, 4])]
[5, [x + 2, 1; x^3 + 3*x^2 + 2, 1]]
[7, [x + 5, 1; x^3 + 2*x^2 + 3*x + 3, 1]]
[11, Mat([x^4 + 6*x^2 + 8*x + 5, 1])]
[13, [x + 8, 1; x^3 + 5*x^2 + 5*x + 9, 1]]
[17, [x^2 + 5*x + 9, 1; x^2 + 12*x + 5, 1]]
[19, [x + 9, 1; x^3 + 10*x^2 + 11*x + 12, 1]]
[23, [x + 3, 1; x + 16, 1; x^2 + 4*x + 20, 1]]
[29, [x + 22, 1; x + 24, 1; x^2 + 12*x + 28, 1]]
[31, [x + 9, 1; x + 25, 1; x^2 + 28*x + 7, 1]]
[37, Mat([x^4 + 6*x^2 + 34*x + 31, 1])]
[41, [x + 24, 1; x^3 + 17*x^2 + 8*x + 10, 1]]
[43, [x + 11, 1; x + 20, 1; x^2 + 12*x + 16, 1]]
[47, [x + 24, 1; x^3 + 23*x^2 + 18*x + 35, 1]]
[53, Mat([x^4 + 6*x^2 + 50*x + 47, 1])]
[59, Mat([x^4 + 6*x^2 + 56*x + 53, 1])]
[61, [x^2 + 18*x + 38, 1; x^2 + 43*x + 48, 1]]
[67, [x^2 + 14*x + 3, 1; x^2 + 53*x + 65, 1]]
[71, Mat([x^4 + 6*x^2 + 68*x + 65, 1])]
[73, Mat([x^4 + 6*x^2 + 70*x + 67, 1])]