Rahul Saha

Logo

Undergraduate student at Princeton University.

Contour Art with Sum of Squares

While I was working with desmos, I plotted the graph of the equation

⌊x⌋² + ⌊y⌋² ≡ 0 (mod p)


for various integers p. It turns out that this equation has non trivial solutions only if p is of the form 4k + 1. This is given by Fermat's Sum of Squares theorem, which states that -1 is a quadratic residue if and only if

p ≡ 1 (mod 4)



Since I liked the interesting pattern depicted above, I decided to do a contour plot of the equation on python for a desktop wallpaper. I used Nord's color palette to customize matplotlib's default color scheme. Below are a couple of examples.

Snorlax



Minimal



Circuit