Possible $k$ in $\frac12(3n^2+n)\equiv k\pmod5$

32 Views Asked by At

Consider $\dfrac12(3n^2+n)\equiv k\pmod5$. How can I myself show that the only possibilities for $k$ are $0$, $1$ or $2$?

1

There are 1 best solutions below

0
On

HINT:

Let $$f(n) =\frac{3n^2+n}2.$$ By brute force, test for $n\equiv0,1,2,3,4\pmod5$.

Solution:

$$f(0)=0\equiv0\pmod5\\f(1)=2\equiv2\pmod5\\f(2)=7\equiv2\pmod5\\f(3)=15\equiv0\pmod5\\f(4)=26\equiv1\pmod5.$$