Mathematical Formulae

1. e to the power of i times pi equals -1

This is the most amazing formula of all and nearly all mathematicians put it at the top of their list of favourite formulae. It's known as Euler's Formula, although so is another formula below.

The formula contains three constants, all with different origins. e is used for logarithms and is connected with exponential growth and radioactive decay, i is the basis for complex numbers and Pi comes, of course, from circles. Put these three together and bingo! you get -1. I have seen this formula so many times but I never fail to be amazed by it.

Rearranging giveswhich now includes five of the most important mathematical constants. 0 and 1 are the foundation stones of arithmetic and their importance is perhaps best appreciated by studying group theory.

Even more amazingly, this formula is a special case of e to the izwhich links e with trigonometric functions, another surprise.

Keith Devlin's book Mathematics: the Science of Patterns Internet Bookshop, Amazon sums things up very well, and there's an excerpt at Euler's Formula.

Read Keith Devlin's speech to graduating students Making the Invisible Visible.

2. Fermat's Little Theorem

There are two theorems linked to Fermat's name and this is the other one. It says that

if p is a prime number and a is an integer then ap-1 - 1 is divisible by p

or, equivalently,

if p is a prime number and a is an integer then ap - a is divisible by p

For example, if p = 13 then 612 - 1 = 2 176 782 335 which is divisible by 13.

This formula is very useful. For example, you can use it to show a number is not prime. 63 - 1 = 215 isn't divisible by 4, so 4 can't be prime. This is blindingly obvious in this case, but is useful for larger numbers.

If ap-1 - 1 is divisible by p for all integers a with no factor in common with p, then it is highly probable that p is prime. However, it needn't be and then p is called a Carmichael number (561 is the smallest).

For a proof of the theorem try Fermat's Little Theorem.

For more on the use of this result see Probable Prime.

3. Euler's formula V - E + F = 1

This is an important formula in graph theory. Draw any two-dimensional graph, that is, a set of a points called vertices, and some line segments called edges which connect the vertices. Make sure it is in one piece (connected in mathematical language). Then count up the number of vertices V, the number of edges E, and the number of faces (regions) F that it encloses.

Then no matter how you do this you will find V - E + F = 1, For example,

Planar graph

(vertices are numbered in black, edges in blue and faces in red)

thus V = 14, E = 21, F = 8 so V - E + F = 14 - 21 + 8 = 1.

Draw your own graph and check it. You will sometimes see the formula written as

V - E + F = 2

because the face outside the graph has been included.

What happens to this formula if you draw it on the surface of a sphere, a torus or just in three dimensions? Euler's Formula in Higher Dimensions

Try to use this formula to show there are only 5 regular solids (known as Platonic solids) Euler's Formula, The Five Platonic Solids and to show there is no solution to an old riddle:

There are three houses each of which must be connected to the water, gas and electricity mains. Can this be done in such a way that the cables and pipes do not cross over or under each other and do not pass through the houses or the mains supply?

Euler developed graph theory to solve the Königsberg bridge problem. There were seven bridges over the River Pregel at Königsberg in Prussia. Euler solved the problem of whether there is a way of traversing each bridge once and only once starting and returning to the same point in the town. Picture of Königsberg bridges. For more information see Topology enters mathematics.

4. Difference of 2 squares

This little formula, called the difference of two squares formula, crops up everywhere, often without warning. For example, the following problem leads to an outrageous polynomial unless you use this formula:

A geometric series has first term p, and eight times the sum of the first six terms is equal to nine times the sum of the first three terms. Find the common ratio of the series.

Fermat used it to factorise large numbers (no calculator or computer was available!) into the product of two numbers roughly equal in size. For example to factorize the number 119143 try the smallest number x so that x2 - 119143 is positive and keep increasing x by 1 until x2 - 119143 is a perfect square, y2 say. Then x2 - 119143 = y2 and so it follows that 119143 = x2 - y2 = (x - y)(x + y) thus factorising 119143 (and what do you get?). This method is known, not surprisingly, as Fermat's method of factoring.

You can use the difference of two squares formula to amaze your friends with your mathematical ability:

  • Find 352 - 342 easily. The formula tells you it's 69 in an instant.

  • You can find squares easily. To find 562 take the two numbers 6 less and 6 more than 56 and multiply them together as 50 × 62 = 3100 (you do know how to multiply by 50 easily don't you?), then add 62 to get 3136 which is 562.

    Use the formula to see how this works.

5. The Prime Number Theorem

This is a difficult to prove formula which gives the number of prime numbers less than a given number. It says:

Prime number theorem

What this means is that if x is any positive real number then pi(x), which is the number of primes less than x, is approximately x divided by log x (where log is to base e, sometimes called the natural log or ln). The ~ means that the approximation is such that pi(x) divided by x divided by log x gets closer and closer to 1 as x gets larger.

Here are some values to see that this formula is reasonable:



x over log x

pi(x)÷x over log x





1 000 000

78 498

72 382


1 000 000 000

50 847 478

48 254 942


Source: An Introduction To The Theory Of Numbers

Perhaps the power of this formula can only be realised when you discover that the primes don't occur in any pattern so that their occurrence is quite hard to pin down.

There's lots more on this formula at How Many Primes Are There?

See also Bertrand's postulate.

6. Number of divisors

Most people are unable to calculate how many divisors that a number has without writing them all down, and doubtless wandering whether they've missed some.

Yet it can be done very easily provided you can factorize the number into powers of prime numbers.

For example, 108 = 22 × 33.

Then you can list all the divisors, including 1 and 108, as made up by multiplying each number in 1, 2, 22 with a number in 1, 3, 32, 33 giving the 12 combinations

1 × 1, 1 × 3, 1 × 32, 1 × 33

2 × 1, 2 × 3, 2 × 32, 2 × 33

22 × 1, 22 × 3, 22 × 32, 22 × 33

Thus there are 12 divisors which comes from adding one to each of the powers in 22 × 33 and then multiplying them together.

You should be able to see how this generalizes to the formula:

IfPrime factors then the number of divisors of n isNumber of divisors

Number of divisors

Divisor Counting

Chimbumu and Chikwama get out of jail

7. Sum of reciprocals of squares

This is a special case (s = 2) of the Zeta Function, first proved by Euler after defeating the best efforts of famous mathematicians like Jacob Bernoulli, Johann Bernoulli and Daniel Bernoulli (all members of the same family).

It is yet another formula that involves the ubiquitous piwhich seems to turn up in all sorts of surprising places.

You can find fourteen different proofs of the formula at Robin Chapman's Home Page, though they are mostly non-elementary. The proofs Evaluating zeta(2) are in DVI, postscript (PS) or PDF file formats.

What is even stranger is that if you pick two positive integers at random, the odds of them having no common divisor are 1 in pi squared over 6which is 1 in 1.644934... . This result, along with others, appears at Notable Properties of Specific Numbers.

8. Wallis's Product

Wallis's product

Yet another formula that gives pi, and it was discovered by John Wallis.

You'll find a simple program that will run on Casio 9x50 calculators which uses Wallis's product at Sanoy's Casio Programs and is repeated here:

Locate 1,1,"TRIES:"
Locate 1,3,"PI:"
Lbl 1
Locate 4,3,2C
Locate 7,1,B
Goto 1

so that you may be able to convert it to run elsewhere.

A much more well-known formula for pi is to use the series for tan-1 and the fact that arctan(1)=pi/4 to get Gregory's Formula

Gregory's formula

This is discussed in How Pi is calculated.


9. Euler (Riemann) Zeta Function

Euler showed that

Riemann zeta function

which can be summarized more neatly as

zeta function

wherezetais the Greek letter zeta and the sum is over all natural numbers n while the product is over all prime numbers p.

It is sometimes known as the Euler zeta function, but because Riemann extended it to complex numbers it is more often known as the Riemann zeta function, which is the subject of one of the most famous unsolved problems in mathematics The Riemann Hypothesis.

This formula is fascinating because it converts a sum of powers to a product of prime numbers, and although it isn't difficult to prove, it is still a surprising result.

We have already said above that zeta(2)=pi squared over 6 but it is also true that

 zeta(4) value, zeta(6) value, zeta(8) value , ...

see Dave's Math Tables.

10. Stirling's Formula

Stirling's formula

This formula is used in probability to help estimate the value of n! As in Prime Number Theorem ~ means that the ratio of the two sides of the formula tend to 1 as n tends to infinity.

What is remarkable is howpi and e get involved in estimating n! when there's no obvious connection with multiplying the integers 1, 2, 3, ... , n together.

Stirling's formula was actually discovered by De Moivre although Stirling did improve it. The formula nowadays is so well-known and seems to have lost its magic so that there are very few references to it on the internet, though you may be able to prove otherwise.



Steve Mayer

Home Problems Facts Books Mathematicians

Jokes Study Links Software Constants Formulae