John D. Cook 7/19/2026

Sum of low squares

Read Original

This article discusses mathematical properties of quadratic residues (squares) modulo an odd prime p, specifically distinguishing between low squares (0 ≤ k < p/2) and high squares (p/2 < k < p). For primes p > 3 where p ≡ 3 mod 4, the sum of all low squares modulo p, called the signature, uniquely identifies p. The article provides Python code to compute the signature and two methods to recover the original prime from the signature: via the largest prime factor of 16s + 1, or by dividing 16s + 1 by the smallest number in {3, 7, 11, 15} that yields a prime. This is based on a 1998 Mathematics Magazine paper by David M. Bloom. While the topic involves number theory and programming, it is more mathematical than IT/technology-focused, but still relates to algorithms and computational number theory.

Sum of low squares

Comments

No comments yet

Be the first to share your thoughts!

Browser Extension

Get instant access to AllDevBlogs from your browser

Top of the Week

No top articles yet