http://benji3up2kxewkqfcq7buxk2xd6zwy3zggnurkrm3l4cvwy2iipvyyad.onion/mirrors/gmpdoc/Perfect-Square-Algorithm.html
Only 44 different values occur for squares mod 256,
so 82.8% of inputs can be immediately identified as non-squares. On a 32-bit system similar tests are done mod 9, 5, 7, 13 and 17, for a total
99.25% of inputs identified as non-squares. On a 64-bit system 97 is tested
too, for a total 99.62%. These moduli are chosen because they’re factors of 2^24 -1 (or 2^48 -1 for 64-bits), and such a remainder can be quickly taken just
using additions (see mpn_mod_34lsub1 ).