hp
toc

Prime Remainders

2015-11-07, post № 79

mathematics, programming, Pygame, Python, #%, #black, #mod, #modulo, #red

This program calculates primes, takes their remainder [1] and then places a color accordingly. The shapes are quiet interesting. [2]

Controls

  • ‘Space’ takes a screenshot.
prime-remainders_mod-10.png
prime-remainders_mod-255.png
prime-remainders_mod-500.png
Source code: prime-remainders.py

Footnotes

  1. The formula for the color 𝑐 at prime 𝑝 with modulo 𝑚 is 𝑐 = 𝑝 mod 𝑚. (𝑚 = 𝟣𝟢 on the left, 𝟤𝟧𝟧 on the right and 𝟧𝟢𝟢 on the bottom)
  2. [2020-07-16] Looking back at it, I am quite surprised that I stumbled upon “analyzing” prime remainders back then, not knowing how deeply rooted in number theory they are.
Jonathan Frech's blog; built 2024/08/31 22:59:44 CEST