Number theory – the queen of math



Trying to learn about Riemann, his zeta function and hypothesis, I ended up reading about Dirichlet. Reading about him, I found in Wiki  that the German mathematician Carl Friedrich Gauss (1777–1855) said,

“Mathematics is the queen of the sciences
and number theory is the queen of mathematics.” 

I thought, of course, I, a retired math teacher, must learn about the queen of mathematics. So I decided to start this page with information about this queen.

I like “numberphiles” introduction but this page will take my first Number theory information from Bullis Student Tutors (see below).

The greatest collection online of Number theory material is found in


  1. introduction
  2. Math letters and number theory symbols (link to a separate page)
  4. The number system
  5. Set theory
  6. Infinity
  7. Number theory areas
  8. Modular arithmetic
  9. Number theory applications
  10. Conclusion
  11. Sources


The number system

can be visualized with this set of complex numbers with its subsets

(Source: Wiki )

  1. imaginary number i 
     is a complex number that can be written modular that has a real number multiplied by the imaginary unit i, which is defined by its property i2 = −1.
  2. complex numbers  a + bi
    A complex number is a number that can be expressed in the form a + bi, where a and b are real numbers, and i is a solution of the equation x2 = −1. Because no real number satisfies this equation, i is called an imaginary number. Despite the historical nomenclature “imaginary”, complex numbers are regarded in the mathematical sciences as just as “real” as the real numbers.
  4. real numbers 
    ( include all the rational numbers, such as the integer −5 and the fraction 4/3, and all the irrational numbers)

    1. rational numbers set (ℚ)
      that can be expressed as the quotient or fraction p/q of two integers,
    2. Bernoulli numbers Bn are a sequence of rational numbers
    3. integers set + 
      consists of zero (0), the positive natural numbers (123, …), also called whole numbers or counting numbers and their additive inverses (the negative integers, i.e., −1, −2, −3, …, when added to a yields zero

      2. natural number set + (used for counting (-3, -2,-1, 0, 1, 2, …)
        • positive
        • negative
        • prime numbers
          “Those numbers you can’t divide into other numbers, except when you divide them by themselves or 1?”
        • composite numbers
          All composite numbers are made up of, and can be broken down (factorized) into a product (a x b) of prime numbers. Prime numbers are in this way the “building blocks” or “fundamental elements” of numbers.
          Jørgen Veisdal in )

          • odd
          • even
          • triangular numbers
            if that number of pebbles can be arranged in a triangle (Joseph H. Silverman, “What is number theory” )
          • perfect numbers  
          • when the sum of all its divisors, other than itself, back up to the original number.
            (like 1 + 2 + 3 = 6 and 1 + 2 + 4 + 7 + 14 = 28 and 496 and more)
          • (Joseph H. Silverman, “What is number theory” )
          • square numbers 
            if that number of pebbles can be arranged in a square (2, like 4, 9, 12,…)
      3.  irrational numbers 
        Whose decimal expansion does not terminate, nor end with a repeating sequence. Examples are:

        1. √2 (1.41421356,  
        2. π  (3.14…..),
        3. Euler’s e (2,71828 18284 59045 23536….)
        4. the golden ratio φ  (1,6180339887….) 
        5. in fact all square roots of natural numbers, other than of perfect squares (ℝ2)
      4. Surreal numbers
        Research on the go endgame by John Horton Conway led to the original definition and construction of the surreal numbers containing the:

        1.  real numbers 
        2. infinite numbers
          larger or smaller in absolute value than any positive real number 
        3. infinitesimal numbers,
          quantities that are closer to zero than any standard real number, but are not zero
      5. Transfinite numbers
        In mathematics, transfinite numbers are numbers that are “infinite” in the sense that they are larger than all finite numbers, yet not necessarily absolutely infinite  
        (with the symbol: Ω. the extension of the idea of infinity proposed by mathematician Georg Cantor. Cantor linked the Absolute Infinite with God,) These include:

        1. the transfinite cardinals,
          which are used to quantify the size of infinite sets, 
          which appeared as the subscripts α in Sα 
        2. the transfinite ordinals,
          which are used to provide an ordering of infinite sets. The term transfinite was coined by Georg Cantor in 1915

Ordinal numbers
Ordinals were introduced by Georg Cantor in 1883[1] in order to accommodate infinite sequences and classify derived sets



Infinity with the symbol is not a number but a concept. Like George Cantor explained, “There are different kinds of infinity”. Some are bigger and some are smaller.

Some can be listed

  • 1,2,3,4,5,6,…..
  • 1,-1,1,-1,1….

fractions and decimals can be listed

Real numbers can not be listed?

Numberphile has a good presentation about infinity


Number theory introduction

Number theory is the study of the set of positive whole numbers 1, 2, 3, 4, 5, 6, 7, . . . , which are often called the set of natural numbers. We will especially want to study the relationships between different sorts of numbers. Since ancient times, people have separated the natural numbersℕ into a variety of different types. Here are some familiar and not-so-familiar examples:

  • odd 1, 3, 5, 7, 9, 11, . . .
  • even 2, 4, 6, 8, 10, . . .
  • square 1, 4, 9, 16, 25, 36, . . .
  • cube 1, 8, 27, 64, 125, . . .
  • prime 2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, . . .
  • composite 4, 6, 8, 9, 10, 12, 14, 15, 16, . . .
  • 1 (modulo 4) 1, 5, 9, 13, 17, 21, 25, . . .
  • 3 (modulo 4) 3, 7, 11, 15, 19, 23, 27, . . .
  • triangular 1, 3, 6, 10, 15, 21, . . .
  • perfect 6, 28, 496, . . .
  • Fibonacci 1, 1, 2, 3, 5, 8, 13, 21, . . .

(read more at )

It has been difficult to find a good Number theory introduction in Youtube.  The best one I have found is this:

Its says among others that

Number theory called Higher arithmetic (from the Greek ἀριθμός arithmos, ‘number’ and τική [τέχνη], tiké [téchne], ‘art’) is essentially a study of

  • the mathematical interactions between the number types in the number system.
  • the mathematical interactions of the imaginary numbers within the number system

Number theory asks questions about the relationships between the number types.

Euclide looked at prime numbers. He studied how many prime numbers exist. He came to a formal proof that was a proof by contradiction (saying that there is a finite number of primes and showed why this was wrong)

Number theory has a lot of real-world applications.

Fundamental Theorem of Arithmetic (FTA)

This says that all numbers can be factored to a unique set och prime numbers. E.g. 12 can be factorized with the primes 2 and 3 like

12 = 3x2x2

Number theory is used for cryptography and large scale networks.

Encryption uses unique prime factorization


Set theory


“A set is a Many which allow itself to be thought of as a One” — Georg Cantor 

The idea of the set was shared by Georg Ferdinand Ludwig Philip Cantor with his Cantor set.

Set is a collection of objects called elements

A example of a set

The intersection of two sets A and B is the set of elements that are in both A and B. In symbols .
For example, if A = {1, 3, 5, 7} and B = {1, 2, 4, 6} then A ∩ B = {1}.

The number 9 is not contained in the intersection of the set of prime numbers {2, 3, 5, 7, 11, …} and the set of even numbers {2, 4, 6, 8, 10, …}, because 9 is neither prime nor even.

A more elaborate example (involving infinite sets) is:

A = {x is an even integer}
B = {x is an integer divisible by 3}
Set builder notation
here are two examples taken from
1. A set of as { 1/2, 1/3, 1/4, 1/4 …} can be written as
ℚ =  { m/n | m,n ∈ ℤ | n ≠ 0 
2. A set of even integers as = { -4 , -2 , 0 , 2, 4, …}
can be written as 2= {2n | n ∈ }

Cardinality of set

“the cardinality of a set is a measure of the “number of elements” of the set. For example, the set contains 3 elements e.g. {2, 4, 6}, and therefore  has a cardinality of 3” ( Wiki ). This can be written as 
|| = 3

finite set

In mathematics, a finite set is a set that has a finite number of elements. Informally, a finite set is a set which one could in principle count and finish counting. For example, 

The set of all integers, {…, -1, 0, 1, 2, …} is a countably infinite set… The set of all real numbers is an uncountably infinite set. The set of all irrational numbers is also an uncountably infinite set 

“In mathematics, the Cantor set is a set of points lying on a single line segment that has a number of remarkable and deep properties. It was discovered in 1874 by Henry John Stephen Smith[1][2][3][4] and introduced by German mathematician Georg Cantor in 1883. Through consideration of this set, Cantor and others helped lay the foundations of modern point-set topology.  “

Russell’s paradox

In the foundations of mathematicsRussell’s paradox (also known as Russell’s antinomy), discovered by Bertrand Russell in 1901,[1][2] showed that some attempted formalizations of the naïve set theory created by Georg Cantor led to a contradiction.  ( Wiki )

ohn Horton Conway talkes about Cantor in this video:

In set theory, you find discussions also about functions like

  • noninjective functions
  • bijections like 
  • non-surjective functions

In mathematics, an injective function (also known as an injection, or one-to-one function) is a function that maps distinct elements of its domain to distinct elements of its codomain. In other words, every element of the function’s codomain is the image of at most one element of its domain. Look at this injective function and its x and y sets.

  • Comments:
    Y ∈ Y (“Y is an element of Y2 “)
  • X1 ⊂ X (“Xis  subset of X“) 


Number theory  areas

This is a translation from the Swedish presentation in Wikipedia, translated by me to English.

Traditionally, number theory is the branch of mathematics that deals with the properties of integersNumber theory has evolved to become an accepted technique for addressing problems even in other branches of mathematics.

Number theory can be divided into several areas depending on the methods used and the problems being investigated:

  1. .Elementary number theory
  2. Analytical number theory
  3. Algebraic number theory
  4. The geometry of number theory
  5. Probabilistic number theory
  6. Algorithmic number theory


1. Elementary NT 

In elementary number theory, integers are studied without the use of any of the techniques from other areas of mathematics. To elementary number theory belongs questions like (links to Wiki):

Examples of the elementary number theorems are(links to Wiki):

included are also an investigation of the properties of arithmetic functions such as(links to Wiki):

Faculty in mathematics is a functionFor an integer greater than zero, the faculty is equal to the product of all integers from 1 up to and including the number itself.

Faculty is expressed as expressed as 

0 1
1 1
2 2
3 6
4 24

Many questions in elementary number theory are exceptionally difficult and require entirely new approaches. A few examples are:

 )Michael Penn, Professor of Mathematics at Randolph College in Lynchburg, Virginia makes a good presentation of the division algoritm, 

  • The division algorithm states that 

    • where ab
    • q is the quotient and r the remainder
    • 0≤r<b a
    • nd b>0 is valid. E.g:
      • if b=2 then a=21=2×10+1
      • if b=6 then a=35=6×5+5
    • integers are denoted with a double-struck boldface Z (Unicode 2124) 
    • x is the same as to say that “x is an element of 

For the proof  a set S, is to be considered.


Michael Penn is proceeding very fast. One that does it slower is “learnable” in this video


infinite number series

I think that the best introduction to infinite series is the one made by 3 Blue1Brown in this youtube:


Eulers zeta function

For s   It an be written as

Read bout its derivation in
With s=1 it can be reduced with s⊂ℝ =1 to the harmonic series that can be “visualized” in music with overtones of a vibrating string:
Zeno’s paradox



Riemann hypothesis

Rieman developed Eulers zeta function to include complex numbers ( s=a + bi ).

The prime number series

2, 3, 5, 7, 11, 13, 17, 19, 23, 29, p. What is p? 31. What is the next p? It’s 37. The after that? 41. And then? 43. How, but… …how do you know what comes next?

Present an argument or formula which (even barely) predicts what the next prime number will be (in any given sequence of numbers), and your name will be forever linked to one of the greatest achievements of the human mind, akin to Newton, Einstein, and Gödel. Figure out why the primes act as they do, and you will never have to do anything else, ever again…
Riemann’s hypothesis about the roots of the zeta function, however, remains a mystery.” (Jørgen

This teacher tells about the Riemann hypothesis in a clear way:

Bernoulli could calculate easily the sum of 110+210+310….+100010

(Source: Mathologer in )

The deriving formula for number series

“Mathologer” makes a great introduction to Bernoulli number series and how to calculate these in this video

Bernoulli calculated this sum in a few minutes buy hand: How did he do? Noone in Mathologers video comments has supplied an answer

“Mathologer” shows graphically in a splendid way how he first approximates and then gets exact answers to several series.
IMPORTANT. All following illustrations are screenshots from Mathologer in

The series Mathologer illustrates are:

  1. 1+2+3+4+5+6+7+8+9+10 = (102+10)/2
    (Tip: the series forms a triangle)
    ⇒1+2+3+..+n =(n2+n)/2 =n(n+1)/2
  2. 1+2+3+4
    (This is a simpler series. To get an exact answer we use two of these triangles.)


    2(1+2+3+4) = The area will be 4(4+1)/2
    so for 2(1+2+3+4+…+n) we get n(n+1)/2

  3. 12+22+32+42
    This serie forms a Mayan square pyramid. The volume formula for this Pyramid is a third of a base area * height. Vp=Ab*h/3
    With this formula, we get an approximate volume of 43/3. To get an exact volume we must use 6 pyramids to make a to build a parallelepiped.


    The volume of six pyramids becomes
    Vp=Ab*h= 6(12+22+32+..42)=4(4+1)(2*4+1)
    As the parallellepiped is made of 6 pyramids, the volume of 1 pyramids is therefore Ab*h = 4 *(4+1)* (2*4+1) / 6
    For a pyramid build of the serie 12+22+32+42+..+n we get therefore the volume

  4. 13+23+33+..43


    13+23+33+..4gives the formula (1+2+3+4)2
    For the serie (13+23+33+..43+..+n) we get the formula (1+2+3+..+n)2

Observe that 13+23+33+43 =(1+2+3+4)2
As 2*(1+2+3+4)=4*(4+1)/2
So ⇒ 13+23+33+43  = (4*(4+1)/2)2

For a infinite cubic serie we get

13+23+33+43  +..+n3= (n(n+1))/2)2

Findiing patterns

(Source: Mathologer in )

Expanding the formulas we get 

n S0  
12+21+31+4+..+n1 (n(n+1))/2 S1 (1/2)2+(1/2)n
12+22+32+4+..+n2 (n(n+1)) (2n+1))/6  S2
13+23+33+..43+..+n3  ((n(n+1))/2)2  S3=(S1)2

Following the pattern above we get

14+24+34+..44+..+n4  1/5)5+(1/2)4+?????

The sums can be expressed with the lower sums as with S3=(S1)2

To get the rest of the 4 dimension series formula, we use an algebraic proceeding.

Binomial identities

is an identity that connects different powers.

“Special cases of the binomial theorem were known since at least the 4th century BC when Greek mathematician Euclid mentioned the special case of the binomial theorem for exponent 2.[1][2] There is evidence that the binomial theorem for cubes was known by the 6th century AD in India.” (Source: wiki )


Pascal triangle

In the binomial identity, the coefficients are taken from the Pascal triangle.

The binomial identity may be shown as (using the (x-1) version:

  • (x-1)0 = 1x
  • (x-1)1 = 1x1-1
  • (x-1)2 = 1x2-2x1+1
  • (x-1)3 = 1x3-3x2+3x1-1
  • (x-1)4 = 1x4-4x3+6x2-4x1+1
  • (x-1)5 = 1x5-5x4+10x3-10x2+5x1-1
 Moving all xto the right we get:

+5x4-10x3+10x2-5x1+1 = x5(x-1)5

Substituting X with 1,2,3,4 get these four equations:

+5*14-10*13+10*12-5*11+1 = 15(1-1)5
+5*24-10*23+10*22-5*21+1 = 25-(2-1)5

+5*34-10*33+10*32-5*31+1 = 35-(3-1)5

+5*44-10*43+10*42-5*41+1 = 45-(4-1)5

Simplifying this we get:

+5*14-10*13+10*12-5*11+1 = 15
+5*24-10*23+10*22-5*21+1 = 2515

+5*34-10*33+10*32-5*31+1 = 35-25

+5*44-10*43+10*42-5*41+1 = 45-35

Adding these 4 equations we get the sum where the marked in red an blue cancel out so only  45remains on the right side.

+5*14-10*13+10*12-5*11+1 = 15
+5*24-10*23+10*22-5*21+1 = 2515

+5*34-10*33+10*32-5*31+1 = 35-25

+5*44-10*43+10*42-5*41+1 = 45-35

We can write the sum as

+5*14-10*13+10*12-5*11+1 = 
+5*24-10*23+10*22-5*21+1 =

+5*34-10*33+10*32-5*31+1 = 

+5*44-10*43+10*42-5*41+1 = 45

And add the n:th general equation:

+5*n4-10*n3+10*n2-5*n1+1= n5


looking at the columns we see that 

5*1+ 5*2+ 5*3+ 5*4+5*n= +5S4

The second column is = -10S3

The third column is = +10S2

The fourth column is = -5S1

The fifth column is = S0

So we get that :

5S-10S3+10S2-5S1+S= n5

Knowing the formulas for S2, S2, S1 and S0 we can get a simplified formula for S4:

(Source: Mathologer in )
See more in 
Mathologer in

NB The coefficient is inverse of the coefficient in the Pascal triangle rearranged in a matrix that is made inverse.


The Ramanujan series and summation

There is a film about this Indian Mathematician Srinivasa Ramanujan:.

Srinivasa Ramanujan wrote to Hardy in England that

where the notation  indicates a Ramanujan summation. (Wiki )

The Rieman zeta function comes to the same result.

It is hard to get make sense of 1+2+3+ … = -1/12 and some of those other notorious, crazy-looking infinite sum identities.

Ramanujan said that he was inspired by a Hindu God called Namagiri He told Hardy about one of these revelations:

“While asleep, I had an unusual experience. There was a red screen formed by flowing blood, as it were. I was observing it. Suddenly a hand began to write on the screen. I became all attention. That hand wrote a number of elliptic integrals. They stuck to my mind. As soon
as I woke up, I committed
them to writing.” ( Wiki )

Hardy at Cambridge, wanted Ramanujan to prove his equations.

As I understand it Ramanujan was offended by this request as his God (Namagiri) does not share lies to a Hindu like Ramanujan. You can not question a God.

After some time,  Ramanujan wrote however proof of the summation to Hardy. Thanks to Hardy’s insisting, we can now explain it.


Ramanujan summation explained

I  found Numberpiles video that explains how you can prove Ramajunan summation

I could take notes of the summations on a paper but I want to be able to read it here on my Number Theory page.
So I share a few print screens from Numberpiles video.

Numberphile uses two series S1 and S2 to get the solution of S

S1 = ½ as where you stop counting you will get either the sum 0 or 1.

We double S2
(OBS! you have to slide the second term of S2 one step to right
as in this screenshot:

I have done that in my  google drive calc and I got this table:

S1 Sum S1 S 4S S2 S2 S2+S2 S-S2
1 1 1 4 1   1  
−1 0 2 8 −2 1 −1 4
1 1 3 12 3 −2 1  
−1 0 4 16 −4 3 −1 8
1 1 5 20 5 −4 1  
−1 0 6 24 −6 5 −1 12

We understand that S1 =  ½ 

As 2S2=Sthen S2= 1/4 

We subtract S2 from S (=S-S2)

By doing this, we get 4*S

As have seen that S2 =  1/4 

This means that  S – 1/4 = 4S. Subtracting 1S from both sides w get that  – 1/4 = 3S

Dividing both sides with 3 we get that S = -1/12 !!!!


Bernoulli numbers

Bernoulli numbers Bn are a sequence of rational numbers.

1/30 is one of the Bernoulli numbers. In fact the Bernoulli numbers are the coefficient for the nth coefficient in the series formulas like in this image below:

(Source: Mathologer in )

The bernoulli numbers with the numbers from the Pascal triangle gives all the coefficients for the series like in the image below. Mathologer shows in his video minute 26:28 how.

(Source: Mathologer in )

OBS. the numbers before the Bernoulli numbers are taken from the Pascal triangle. So with the Bernoulli numbers and the Pascal triangle you can write down any of the sums. Like

S10= 1B0n11 12B1n10 66B2n9 220B3n8 495B4n7 792B5n6 924B6n5 792B7n4 49B8n3 220B9n2 66B10n

I took out the coefficient creating a Pascal triangle in a Google Excel sheet

So the numbers that reappear in the result

(Source: Mathologer in )

may have to do with the pascal triangle used in the sum equation.

The Bernoulli numbers appears in many ways like this

(Source: Mathologer in )

And they appear also in the Riemann zeta function I wrote about in a separate page.

(Source: Mathologer in )


2. Analytical NT

Analytical number theory uses analysis and complex analysis as a tool to address integer issues. Examples are the prime number and the related Riemann hypothesis . Other problems encountered with analytical methods are Waring’s problem , that a given integer represents a sum of squares, cubes, the prime numbering assumption, to find infinitely many prime pairs with the difference 2 and Goldbach’s premise, which suggests that even integers are the sum of two prime numbers.

Evidence that certain mathematical constants such as π and e are transcendent also belongs to analytical number theory. Statements about transcendent number appear to have moved from the study of integers. However, possible values ​​of polynomials with integer coefficients for, for example, e, which are closely linked to the range of diophantic approximation, are studied .

Examples of methods used in analytical number theory are Hardy – Littlewood’s circular method , L functions and modular shapes .


3. Algebraic NT

algebraic number theory is a branch of number theory that uses the techniques of abstract algebra to study the integersrational numbers, and their generalizations. ( Wiki

In algebraic number theory, the number area is expanded to include algebraic numbers, which are zeros to polynomials with coefficients that are integers. This set contains elements that are analogous to integers and are called algebraic integers . For these, well-known properties, such as unique factorization, no longer need to apply. The tools employed are: 

These tools give this number regions a partial order structure.

A large number of theoretical issues are addressed by studying the integers modulo p for all prime numbers p infinite bodies. This is called localization and leads to the construction of p-adic numbers . This type of study, which arose from algebraic number theory, is called local analysis .

An important area of ​​algebraic number theory is the Iwasawa theory.

Diophantine equations may belong to this area too
“Diophantine equationequation involving only sums, products, and powers in which all the constants are integers and the only solutions of interest are integers. For example, 3x + 7y = 1 or x2 − y2 = z3, where x, y, and z are integers. Named in honour of the 3rd-century Greek mathematician Diophantus of Alexandria, these equations were first systematically solved by Hindu mathematicians beginning with Aryabhata (c. 476–550).” . Read more at
and in

Bernoulli numbers Bn are a sequence of rational numbers
Bernoulli could calculate easily the sum of


Mathologer makes a great introduction to numbers series and how to calculate these in this video


4. Geometry of NT

Geometric number theory encompasses all forms of geometry. It starts with Minkowski’s theorem,

The theorem was proved by Hermann Minkowski in 1889 and became the foundation of the branch of number theory called the geometry of numbers.

Minkowski’s theorem, is the statement that every convex set of  which

  • is symmetric with respect to the origin
  • and which has volume greater than  

contains a non-zero integer point.

The boundary of a convex set is always a convex curve. The intersection of all the convex sets that contain a given subset A of Euclidean space is called the convex hull of A. It is the smallest convex set containing A.

With Minkowsky’s theorem, one can also apply algebraic geometry , especially the theory behind elliptic curves . Fermat’s large proposition has been proven using these techniques.


The circle (black) intersects the line (purple) in two points (red). The disk (yellow) intersects the line in the line segment between the two red points.

Convex set

 Non convex set The red concave line segments  contain the smallest convex set.


Convex function

function is convex if and only if its epigraph, the region (in green) above its graph (in blue), is a convex set.

Primes and geometry

3 Blue 1 Brown shows a nice connection between primes, spirals and rays in this video:

Some images taken from this video:

Using prime numbers for radius () and angel in radius

Each residue class from a spiral 


1729, the Ramanujan number

It is a taxicab number, and is variously known as Ramanujan’s number and the Hardy–Ramanujan number, after an anecdote of the British mathematician G. H. Hardy when he visited Indian mathematician Srinivasa Ramanujan in hospital.  (From the film “The Man Who Knew Infinity”.Hardy related their conversation:

I remember once going to see him when he was ill at Putney. I had ridden in taxi cab number 1729 and remarked that the number seemed to me rather a dull one, and that I hoped it was not an unfavourable omen. “No,” he replied, “it is a very interesting number; it is the smallest number expressible as the sum of two cubes in two different ways.” ( Wiki )

The two different ways are:

1729 = 13 + 123 = 93 + 103


5. Probabilistic NT

Probabilistic number theory addresses the likelihood of different number phenomena occurring within intervals or as relationships, such as the number of prime numbers within anumber interval.

This number theory has also led to the discovery of algorithms that Cramér’s assumption .


6.  Algorithmic number theory

In this area, algorithms are studied . Fast algorithms for prime number testing and integer factorization have widespread application in cryptography .


Modular arithmetic NT

“Modular arithmetic is the part of number theory used to study cyclical systems: systems where taking enough steps “forward” brings you back to where you started.” (


Modular arithmetic uses often special symbols. I have these linked here 


“Image 1 is congruent (superimposable) only with image 2. Image 1 is similar but not congruent to image 3.”

In modular arithmetic the word congruence is used as in

Given an integer n > 1, called a modulus, two integers are said to be congruent modulo n if n is a divisor of their difference, that is, if there is an integer k such that a − b = nk. Congruence modulo n is denoted: 

In modulo 5 residue class 
5k+3 Ξ 3, 8, 13,18, 23,,…

One can easily see that:  
23 ≡ 3 (mod 5) as 23/5 =4 +3
23 ≡ 13 (mod 5) as 23/5=2+13
23 ≡ 18 (mod 5) as 23/5 =1+18

( WIki )

In the wheels below you find the congruent numbers in the same sector.


“in classic arithmetic, adding a positive number a to another number b always produces a number larger than b. In modular arithmetic this is not always so. For example, if it is now 4 o’clock and we “add” 23 hours, the time will then be 3 o’clock, which doesn’t appear to be larger than 4 o’clock.”(Source: )

“A number is said to be congruent to 1 (modulo 4) if it leaves a remainder of 1 when divided by 4” ( )

Residue class modulo 4 is therefore = 4k+1 = 1,5,9,17,…

Modulo 5 wheel:
Residue classes modulo 5
5k+1 Ξ 1, 6, 11,16, 21,…
5k+n Ξ n, 5+n, 10+n,15+n, 20+n,…

The number in the blue section are all congruent to each other.
(Source: ZachStar video: )

Modulo 7 wheel:
Residue classes modulo 7
7k+1 Ξ 1, 8, 15,16, 22,…
7k+n Ξ n, 7+n, 14+n,21+n, 28+n,…
(Source: ZachStar video: )

Modulo 7 wheel with conclusion:(Source: ZachStar video: )

Modulo 12 wheel:

Residue classes modulo 12
12k+1 Ξ 1, 13, 25,37, 49,…
12k+n Ξ n, 12+n, 24+n,36+n, 48+n,…
Each section contains congruent numbers:
The number in the 5 section are all congruent to each other.
53/12=1 +41 ⇒ 53 Ξ 41 (modulo 12)  or

41/12=1+29 ⇒ 41 Ξ 29 (modulo 12)  or …
(Source: ZachStar video: )

2 =14 in the clock. it is said that 2 is congruent ( ≡ ) to 14 modular 12

This can be written as 14 (mod12)   ≡ 2

14/12 =1 +2

the parentesis is not to be forgotten as if you write “14 mod 12”  then it  refers to the modulo operation used in computing lagnguages where you are looking to the rest of a division e.g. 15 mod 12 = rest 2.

 Residue classes mod 6

(Source: 3Blue1Brown )

also these congruences are valid

14 (mod12)   ≡ 2

26 (mod12)   ≡ 2

38 (mod12)   ≡ 2

50 (mod12)   ≡ 2

14, 26,38, 50 are part of the congruence class of 2(mod 12)
(Source: )

37 ≡  57(mod 10)


The congruence relation may be rewritten as


because 38 − 14 = 24, which is a multiple of 12, or, equivalently, because both 38 and 14 have the same remainder 2 when divided by 12.

“modular arithmetic is a system of arithmetic for integers, where numbers “wrap around” when reaching a certain value, called the modulus. The modern approach to modular arithmetic was developed by Carl Friedrich Gauss in his book Disquisitiones Arithmeticae, published in 1801.

A familiar use of modular arithmetic is in the 12-hour clock, in which the day is divided into two 12-hour periods. If the time is 7:00 now, then hours later it will be 3:00. Simple addition would result in 7 + 8 = 15, but clocks “wrap around” every 12 hours. Because the hour number starts over after it reaches 12, this is arithmetic modulo 12. In terms of the definition below, 15 is congruent ( ) to 3 modulo 12, so “15:00” on a 24-hour clock is displayed “3:00” on a 12-hour clock.

For example,

The definition of congruence also applies to negative values:

” (Wiki )

I find this video is very interesting as it shows how modular arithmetic can be used.


NT applications

Modular arithmetic in Cryptography

Zach start shares about cryptography with prime number and modular arithmetic in his ZachStar video: from minute 16
In cryptography, modular arithmetic directly underpins public key systems such as RSA and Diffie–Hellman, and provides finite fields which underlie elliptic curves, and is used in a variety of symmetric key algorithms including 

Modular arithmetic in banc account numbers
International Bank Account Numbers (IBANs), for example, make use of modulo 97 arithmetic to spot user input errors in bank account numbers. (Wiki

In computer science
The logical operator XOR sums 2 bits, modulo 2 ( Wiki




conclusion – ongoing process

I had a tough start with issue searching for a good introduction.

I then understood that this is a huge part of mathematics that will take a long time to explore and maybe my lifetime to understand.



A pluralist agnostic seeker

Insert math as
Additional settings
Formula color
Text color
Type math using LaTeX
Nothing to preview