# Thread: Factoring polynomials over Z/nZ

1. ## Factoring polynomials over Z/nZ

The irreducible quadratic n^2-5n+18 factors as (n-6)(n+1) mod 24. How can I determine this algorithmically?

2. While I personally never have seen a problem like this, I would solve it as follows.
Find two numbers, that when added give the "b". (-6,+1), but (-3, -2) also works here.
Then use long division with your functions to calculate the remainder of n^2-5n+1/((n-6)(n+1))
3. $(n- 6)(n+ 1)= n^2- 5n- 6$. since 6+ 18= 24= 0 (mod24), -6= 18 (mod 24) so this is the same as $(n- 6)(n+ 1)= n^2- 5n+ 18$ (mod 24).