Where Math Meets Visual Art
Creative Coding & Interactive Web Playground
The Secret Life of Numbers: Order from Chaos (or What Are Prime Numbers?)
In this article, I will show you a side of the world of numbers that might remain hidden at first glance. Let's move beyond dry school definitions and see what surprising structures lurk behind the simplest digits!
The Boring String of Beads
Let's start with the simplest things: integers. At first glance, they don't seem very exciting. The recipe is simple: take 1, add another 1, then another 1, and so on to infinity.
If we want to visualize this, numbers are like regular strings of beads. We can have a chain of 5 beads, 10 beads, or 100 beads. If we stay in the world of addition, these strings of beads look completely identical, unstructured, differing only in their length. But what happens if we put on a different pair of glasses?
Let's Cut Them Up!
Let's step into the world of multiplication and division. Here, the main question is no longer how long the chain is, but: how can we cut it into equal pieces without any leftovers?
The number 12, for example, is an extremely "friendly," easily dissectible number. We can break it down into:
- 2 pieces of 6,
- 3 pieces of 4,
- 4 pieces of 3,
- or 6 pieces of 2.
But not every number is this cooperative. Let's look at 71, for example. One might think that if a much smaller number like 12 can be taken apart in multiple ways, then a number as big as 71 could surely be broken down into smaller, equal parts. But we try in vain! We cannot find any number (other than 1 and itself) by which it is divisible without a remainder.
Many such "indivisible" numbers are hiding between 1 and 100. Here is the list:
2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97.
We call these prime numbers.
The Mystery of the Infinite Ocean
The question may arise: is there a largest prime number? Common sense might suggest that as numbers grow larger, they have more divisors, so eventually, primes must run out. But mathematics has proven that there is no largest prime number. There are infinitely many of them.
Apart from prime numbers, every other number is a composite number. This means they can be broken down into smaller, equal parts. But how do we find the primes in this infinite sea?
The bad news: mostly by trial and error. There is no simple "magic formula" where we can plug in values and get the next prime number. The distribution of primes on the number line appears completely irregular. Although statistically true that they become rarer among larger numbers, exactly where the next one will pop up remains a mystery until we calculate it.
The Sieve of Eratosthenes: An Ancient Method
One of the oldest and most elegant methods for hunting prime numbers was developed by a Greek mathematician, Eratosthenes. The essence of the method is "sieving":
- Arrange the numbers in order and find the smallest prime: this is 2.
- Since every multiple of 2 is definitely not prime (as it is divisible by 2), we immediately "sieve" them out, crossing them off. With this, we have already laid waste to all even numbers.
- The next remaining number is 3. This is definitely prime. Now, let's cross out all multiples of 3 (9, 15, 21...), as they cannot be primes either.
- The next remaining number is 5. This is also prime. Let's cross out the multiples of 5...
And so on. Whatever remains at the end of the sieving is a pure prime number.

Sieve of Eratosthenes
Try the Sieve of Eratosthenes to find the prime numbers.
The DNA of Numbers
Why is this so important? Because we can state a fundamental truth: every composite number can be written as a product of prime numbers.
For example, 12 = 2 × 2 × 3.
This decomposition reveals everything about the internal structure of the number. Exactly how the number 12 can be cut into pieces is determined by these prime factors.
Moreover, there is an even more interesting fact: every number can be decomposed into primes in only one way (disregarding the order). For example, 24 can be written as 4 × 6 or 3 × 8, but if we break it down to the final building blocks, we always get the same result: 2 × 2 × 2 × 3.
The Odd One Out: The Mystery of 1
It is precisely because of the rule above that we can answer a frequently asked question: Why is 1 not a prime number? After all, it is divisible only by one and itself!
The answer lies in the unique "DNA" of numbers. If we considered 1 a prime number, the rule that every number can be decomposed in only one way would collapse.
Think about it: 6 can be written as 2 × 3. But if 1 were also prime, we could write it as 1 × 2 × 3, or 1 × 1 × 2 × 3, and so on to infinity. The "chemical formula" would lose its uniqueness. Therefore, mathematicians decided to exclude 1 from the club of prime numbers. It is a separate category: the unit.
The Padlocks of the Digital World
But why should this interest us in everyday life? We might think prime numbers are just playthings for mathematicians, but in reality, the modern world wouldn't function without them.
Every time you pay with a credit card or log into social media, prime numbers are protecting your data.
The basis of encryption is an interesting asymmetry: it is very easy for a computer to multiply two huge prime numbers together (this is what it does when encrypting), but it is impossibly difficult to deduce the original two numbers from the result (this would be hacking). Prime numbers are, therefore, the padlocks of our digital world.
LEGO and Chemistry
From this perspective, numbers are no longer boring strings of beads. They are much more like unique structures.
Think of LEGO:
- Prime numbers are the different types of basic bricks (the 2x2 brick, the 3x1 plate, etc.).
- Composite numbers are the finished models we build from them.
We can take any complex structure (composite number) apart into these basic elements, but the basic elements cannot be broken down further.
Or we can use a chemical analogy, which is perhaps even more accurate: 1 is the subatomic particle, prime numbers are the chemical elements (atoms), and composite numbers are the molecules. Just as a water molecule always consists of two hydrogens and one oxygen, the number 12 is always built from two 2s and one 3.
The Sound of Primes
If LEGO bricks seem too static, let's imagine numbers as polyphonic chords.
Every prime number is a pure tone, a frequency. Composite numbers are musical chords kneaded from these tones. But how can we separate these sounds to find out what the chords are made of?
In physics, resonance is used for this. If we strike a tuning fork, only objects that are "divisible" by its frequency will start to vibrate with it. We can perform a similar test with numbers! We send different "number-waves" at them and observe where they resonate (where they are divisible without a remainder).
Let's look at the numbers 11 and 12, for example:
The 11 remains silent at almost every frequency. This is not surprising, as it is a prime number: it resonates only with 1 and itself.
The 12, however, is a veritable orchestra! It resonates strongly with 2, 3, 4, and 6 as well.
Try it out in the simulator below! Use the top slider to select the number, and use the bottom slider to find a wavelength that "hits" the rhythm.

Modular Wave Simulator
Try out which frequencies different numbers resonate with. The magenta rectangles show the divisors of the number.
The Music of Primes
It is even more exciting if we don't just test waves one by one, but see the entire "score" at once.
If we create a graph from the resonances, the spectrum of the numbers reveals itself—their internal fingerprint. Since every number has a unique structure, their graph is also unique.
- For prime numbers, the image is simple and clean: just a flat line, as they have no real divisors.
- Square numbers or numbers with many divisors, however, show a complex, spiky "cityscape."
The larger and more complex a number, the richer its internal structure. With the spectroscope below, you can look inside the numbers yourself. The protruding peaks indicate the hidden building blocks.

Integer Spectroscope
Try to see what frequencies different numbers resonate with. The peaks show the divisors of the number.
What's Next?
We can see, then, that the world of numbers actually consists of two layers: there are the atomic building blocks (the primes), and there are the structures built from them. But what happens if we are not dealing with whole pieces? In the next part, we will leave the solid ground and take a trip into the world of fractions.
Have a Crazy Idea?
Whether you need a generative brand identity, an interactive 3D website, or just want to visualize a complex concept—let’s bring it to life.
