(In reply to re(2): computer solution
by Ady TZIDON)
2^N mod 17 has a cycle of 8:
n^2 mod 17 has a cycle of 17:
We are looking for values of n where the two match
Consider the cycle of 17.
1 of the values (0) can never match.
For the other 16 values, they match one time out of 8. Altogether, they match 2 times out of 17 for a complete cycle of 8*17 = 136 consecutive n.
In other words, they match 16 times in any set of 136 consecutive n. Which explains the result.
The first ones that match are n = 2,4,16,31