#
DIFF.BLOG
New
Following
Discover
Jobs
More
Top Writers
Suggest a blog
Upvotes plugin
Report bug
Contact
About
Privacy
+
Create new post
Create new blog
Add your blog
Sign up
The home for great developer writing.
We surface the best developer writing from thousands of independent blogs, updated daily.
Join Diff.blog
TOPICS
Finding a non-square mod p
·
John Cook
·
Feb. 14, 2026, 10:09 p.m.
Computing
Math
Number theory
mathematics
algorithms
Number theory
Prime numbers
Summary
This blog post discusses the algorithm by Stan Wagon for expressing an odd prime p as a sum of two squares and the prerequisite of finding a non-square mod p, which is a number c that is not congruent to the square of any integer mod p.
Read full post on www.johndcook.com →
MORE POSTS LIKE THIS
Finding a square root of -1 mod p
John Cook ·
Feb 14, 2026
Math
Number theory
The Most Outrageous Conjecture in the World
Combinatorics and more ·
Oct 14, 2026
Logic and set theory
Number theory
Gilbreath’s conjecture: a Cramér random model and a deterministic analysis
Terence Tao ·
Jul 11, 2026
math.CO
math.NT
Masullo on the Riemann Hypothesis
John Carlos Baez ·
Nov 22, 2026
mathematics
riemann hypothesis
SciFort: SciPy algorithms in Fortran
Fortran Lang Discourse ·
Nov 23, 2026
Fortran
SciPy
Mono in the partial ordering of measures of disorder
The Sparkelling Bedangler ·
Nov 1, 2026
presortedness
mathematics
Discover more posts →
AUTHOR
RECENT POSTS FROM THE AUTHOR
Choose how you want to continue.
Continue with GitHub
Continue with Google
By continuing, you agree to our
Privacy Policy
.