Importance of prime numbers

Ravi Jain
4 min readOct 11, 2018

--

A prime number is a number that is only divisible by one and itself, which is essentially saying that it has no divisor. Primes are of the utmost importance to number theorists because they are the building blocks of whole numbers. They are also important to the world because of their mathematical properties which make them perfect for some of our use-cases. Let's discuss some of the practical use of prime numbers in real life.

Cryptography

Whenever you buy something using your credit card on online portals say at Amazon, eBay or Flipkart, prime numbers spring into action. Before your card number is sent over the wires, it must be encrypted for security, and once it’s received by the merchant, it must be decrypted. One of the most common encryption schemes, the RSA algorithm, is based on prime numbers. It uses a “public key,” information that is publicly available, and a “private key,” something that only the decoding party (merchant) has. Roughly speaking, the public key consists of a large number that is the product of two primes, and the private key consists of those two primes themselves. It’s very difficult to factor a given large number into primes. For example, it took researchers two years recently to factor a 232-digit number, even with hundreds of parallel computers. That’s why the RSA algorithm is so effective.

Diffie-Hellman Key Exchange

Alice and Bob want to share a secret key for use in a symmetric cipher, but their only means of communication is insecure. Every piece of information that they exchange is observed by their adversary. It looks an impossible problem to solve. Thanks to prime numbers again !!

  • Alice and Bob agree on a prime number, p, and a base, g, in advance. For our example, let’s assume that p=23 and g=5.
  • Bob chooses a secret integer b whose value is 15 and computes B = g^b mod p. In this example, B has the value of 19.
  • Alice sends A to Bob and Bob sends B to Alice.
  • To obtain the shared secret, Alice computes s = B^a mod p. In this example, Alice obtains the value of s=2
  • To obtain the shared secret, Bob computes s = A^b mod p. In this example, Bob obtains the value of s=2.
  • The algorithm is secure because the values of a and b, which are required to derive s are not transmitted across the wire at all.

Cicada’s love affair to prime numbers

Cicadas are insects which hibernate underground and emerges after a certain number of years. Most predators of cicada have a two-to-ten-year population cycle. If cicada emerges every twelve years, the twelve-year cicadas would be a feast for any predator with a two-, three-, four-, or six-year cycle. By this reasoning, any cicada with a development span that is easily divisible by the smaller numbers of a predator’s population cycle is vulnerable.

Prime numbers, however, can only be divided by themselves and one; they cannot be evenly divided into smaller integers. Cicadas that emerge at prime-numbered year intervals, like the seventeen-year Brood II set to swarm the East Coast, would find themselves relatively immune to predator population cycles since it is mathematically unlikely for a short-cycled predator to exist on the same cycle. A cicada that emerges every seventeen years and has a predator with a five-year life cycle will only face a peak predator population once every eighty-five (5 x 17) years, giving it an enormous advantage over less well-adapted cicadas.

‘Stomp-Stomp-Clap’ Section Of ‘We Will Rock You’

Brian May, the lead guitarist Queen wanted to achieve a sense of a crowd stomping and clapping in We Will Rock You. Before Queen made it big, May was studying astrophysics at Imperial College in London.

He used prime numbers as the basis for timing the delay when they layered the stomp/stomp/clap sounds, to get a good crowd effect. In his own words from an interview, he says: ‘Suppose there were 1,000 people doing this; what would be happening?’ And I thought, ‘Well, you would be hearing them stamping. You would also be hearing a little bit of an effect, which is due to the distance that they are from you.’ So I put lots of individual repeats on them. Not an echo but a single repeat at various distances. And the distances were all prime numbers. Now, much later on, people designed a machine to do this. But that’s what we did. When we recorded each track, we put a delay of a certain length on it. And none of the delays were harmonically related. So there’s no echo on it whatsoever, but the clapped sound — they spread around the stereo, but they also kind of spread from a distance from you — so you just feel like you’re in the middle of a large number of people stamping and clapping.”

References

  1. Cicada’s love affair with Prime Numbers

--

--