Degree reduction
Task number: 2632
In \(\mathbb Z_p\) find a polynomial \(r\) of degree at most \(p\), that attains the same values as the polynomial \(q\) for all \(x\in \mathbb Z_p\).
Variant 1
In \(\mathbb Z_5\), \(q(x)=4x^{20}+3x^{17}+2x^{16}+x^{13}+3x^{12}+2x^{10}+4x^9+2x^7+2x^5+x+3\).
Variant 2
In \(\mathbb Z_7\), \(q(x)=5x^{16}+6x^{15}+4x^{13}+x^{12}+3x^{11}+6x^{10}+2x^9+3x^7+5x^5+2x+1\).