# Calculate f(0 mod 3)+f(1 mod 3)+f(2 mod 3) in residue class Z3 f(x)=x^3+2x^2+2 (coeff. are residues)

*print*Print*list*Cite

You should come up with the following notation 0 mod 3 = `hat 0` , 1 mod 3 = `hat 1` , 2 mod 3 = `hat 2` .

You need to determine the terms of residue class `Z_3` such that:

`Z_3 {hat 0 ; hat 1 ; hat 2}`

You need to evaluate `f(hat 0),` hence, you should substitute `hat 0` for x in equation of the function such that:

`f(hat 0) = (hat 0)^3 + hat 2(hat 0)^2 + hat 2`

`f(hat 0) = (hat 0) + hat 2(hat 0) + hat 2`

`f(hat 0) = hat 2`

You need to evaluate `f(hat 1), ` hence, you should substitute `hat1` for x in equation of the function such that:

`f(hat 1) = (hat 1)^3 + hat 2(hat 1)^2 + hat 2`

`f(hat 1) = hat 1 + hat 2 + hat 2`

You need to group the terms such that:

`f(hat 1) = (hat 1 + hat 2) + hat 2`

`f(hat 1) = hat 0 + hat 2`

`f(hat 1) = hat 2`

You need to evaluate `f(hat 2), ` hence, you should substitute `hat2` for x in equation of the function such that:

`f(hat 2) = (hat 2)^3 + hat 2(hat 2)^2 + hat 2`

`f(hat 2) = hat 2*hat 2*hat 2 + hat 2*hat 2*hat 2 + hat 2`

`f(hat 2) = hat 1*hat 2 + hat 1*hat 2 + hat 2`

`f(hat 2) = hat 2 + hat 2 + hat 2`

`f(hat 2) = hat 1 + hat 2`

`f(hat 2) = hat 0`

You need to evaluate `f(hat 0) + f(hat 1) + f(hat 2)` such that:

`f(hat 0) + f(hat 1) + f(hat 2) = hat 2 + hat 2 + hat 0`

`f(hat 0) + f(hat 1) + f(hat 2) = hat 1 + hat 0`

`f(hat 0) + f(hat 1) + f(hat 2) = hat 1`

**Hence, evaluating `f(hat 0) + f(hat 1) + f(hat 2)` yields `f(hat 0) + f(hat 1) + f(hat 2) = hat 1.` **