Hacker News new | ask | show | jobs
by alexkus 4966 days ago
p^2 mod 40 being one of a small set of numbers is related to quadratic reciprocity.

All odd numbers have a p^2 mod 40 value that is 1, 9 or 25.

The margin isn't big enough for my proof, but only odd numbers with a multiple of 5 will have a p^2 mod 40 value that is 25. Once you remove the case for p=5 (by ignoring the 'inner ring' of numbers where p^2 < 40) then the only valid residues for odd numbers (that aren't multiples of 5) are 1 or 9, but, more importantly this is true whether they are prime or not.