Prime Number Pyramid Visualization
films
Licence
Crédits
- Errachdi & Akenkou
500,000 Numbers Reveal the Geometry of Prime Numbers | Prime Pyramid
What happens when prime numbers are arranged in a mathematical pyramid?
Prime Number Pyramid is a mathematical animation exploring the distribution of prime numbers among the integers from 2 to 500,000.
Each integer belongs to a row determined by consecutive perfect squares. Row n contains the integers from n² to (n+1)² − 1, forming a symmetric arrangement around a central axis.
The mathematical structure is defined by:
-
Left boundary: L(n) = n²
-
Right boundary: R(n) = (n+1)² − 1
-
Central axis: A(n) = n(n+1)
-
Position within a row: P(n,k) = n(n+1) + k, where −n ≤ k ≤ n
Only prime numbers are displayed as red points. As the animation progresses, the camera gradually zooms out to reveal the distribution of 41,538 primes up to 500,000.
Blue lines highlight the central axis and the triangular boundaries of the pyramid. The mathematical formulas appear at the end of the animation, revealing the underlying structure.
Created using Python, NumPy, Matplotlib, and FFmpeg, this visualization combines number theory, computational geometry, and mathematical art.
The project illustrates the distribution of prime numbers within a deterministic geometric arrangement; it does not claim to establish a new theorem about prime numbers.







































































































