The Hidden Geometry of Palindromic Numbers — One Billion Integers
film
Lisans
Emeği Geçenler
What happens when palindromic numbers are transformed into geometry?
This mathematical visualization explores 109,997 palindromic integers up to one billion. Using two simple trigonometric equations, each number becomes a point in the plane.
As the points accumulate, an intricate, colorful geometric structure emerges.
Created with Python, NumPy, and Matplotlib, the animation reveals how a deterministic mathematical process can produce unexpectedly beautiful visual patterns.
Can a simple mathematical transformation reveal unexpected geometric structures within a familiar sequence of numbers?
This visualization investigates that question using palindromic integers — numbers that read identically forwards and backwards, such as 11, 101, and 12321.
The Mathematical ExperimentAll palindromic integers from 2 up to 1,000,000,000 are considered. This produces exactly 109,997 palindromic numbers, each represented by a single point in the plane.
For every palindrome (n), its coordinates are calculated using:
$$
x(n) = n \sin(n)\cos(n)
$$
$$
y(n) = n \sin^2(n)
$$
All trigonometric functions use radians.
The coordinates are determined entirely by these equations. No random placement, manually drawn curves, or geometric corrections are involved.
How the Pattern EmergesThe visualization plots each palindromic integer as an individual point in the plane.
As the number of plotted palindromes increases, the points reveal visually striking arrangements, including curved bands, branching formations, and fan-like structures.
These arrangements arise from the combination of two mathematical ingredients: the discrete sequence of palindromic integers and the oscillatory behavior of the trigonometric coordinate transformation.
Importantly, the visualization consists entirely of discrete points. The apparent curves are visual structures formed by these points, rather than explicitly drawn continuous lines.
The experiment illustrates the geometry produced by this particular transformation of palindromic numbers. It does not establish that the observed structures are unique to palindromes.
A Geometric InterpretationEach palindromic integer (n) is mapped to a point using:
$$
x(n)=n\sin(n)\cos(n)
$$
$$
y(n)=n\sin^2(n)
$$
Using standard trigonometric identities, these equations can be rewritten exactly as:
$$
x(n)=\frac{n}{2}\sin(2n)
$$
$$
y(n)=\frac{n}{2}\left(1-\cos(2n)\right)
$$
Here, (n) is measured in radians when used as a trigonometric argument.
The transformed equations reveal two important features: the trigonometric terms introduce oscillation, while the factor (n/2) increases the scale of the coordinates as the numbers grow.
Furthermore, since (y(n)=n\sin^2(n)) and (n) is positive, every plotted point lies on or above the horizontal axis.
The resulting geometric structures are therefore consequences of a precisely defined mathematical mapping applied to a selected sequence of integers.
This experiment demonstrates how elementary trigonometric functions and discrete number sequences can combine to produce complex and visually compelling mathematical patterns.
Computational Implementation
The project was developed in Python using NumPy for numerical computation and Matplotlib for visualization. FFmpeg was used to render the animation.
Palindromic numbers are generated directly rather than testing every integer individually, allowing the experiment to scale efficiently to one billion.
The animation progressively reveals the points and uses a dynamic camera to follow the growing structure.
Source Code and ReproducibilityThe complete Python implementation is available on GitHub:
The source code allows others to reproduce the visualization, change the numerical range, and investigate related mathematical sequences.
KeywordsPalindromic numbers, number theory, trigonometry, computational mathematics, mathematical visualization, generative geometry, Python.







































































































