John D. Cook 2/13/2026

Expressing a prime as the sum of two squares

Read Original

The article discusses Fermat's theorem that an odd prime p can be expressed as the sum of two squares if and only if p ≡ 1 mod 4. It examines Gauss's elegant but computationally inefficient formula for finding such squares and contrasts it with Stan Wagon's more practical algorithm, which uses quadratic non-residues and the Euclidean algorithm for efficiency.

Expressing a prime as the sum of two 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