Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

What are some surprising equations / identities that you have seen, which you would not have expected?

This could be complex numbers, trigonometric identities, combinatorial results, algebraic results, etc.

I'd request to avoid 'standard' / well-known results like $ e^{i \pi} + 1 = 0$.

Please write a single identity (or group of identities) in each answer.

I found this list of Funny identities, in which there is some overlap.

share|cite|improve this question

closed as too broad by quid, Eric Wofsey, S.Panja-1729, avid19, Sally Oct 28 '15 at 1:13

There are either too many possible answers, or good answers would be too long for this format. Please add details to narrow the answer set or to isolate an issue that can be answered in a few paragraphs.If this question can be reworded to fit the rules in the help center, please edit the question.

I really can't believe no one has posted this yet: – mikeTheLiar Sep 26 '13 at 14:48
This is not in line with what you are looking for, but as a child I discovered that 10million pi is the number of seconds in a year to 1/2% accuracy. This is useful for quick back of envelope calculations, where seconds are involved. – JoeTaxpayer Sep 26 '13 at 19:48
Pi seconds is a nanocentury! – Oscar Cunningham Oct 1 '13 at 21:59
The three trigonometric identities in the following exercises of my Wikibook:… – DVD Oct 12 '15 at 2:51

92 Answers 92

This one by Ramanujan gives me the goosebumps:

$$ \frac{2\sqrt{2}}{9801} \sum_{k=0}^\infty \frac{ (4k)! (1103+26390k) }{ (k!)^4 396^{4k} } = \frac1{\pi}. $$

P.S. Just to make this more intriguing, define the fundamental unit $U_{29} = \frac{5+\sqrt{29}}{2}$ and fundamental solutions to Pell equations,

$$\big(U_{29}\big)^3=70+13\sqrt{29},\quad \text{thus}\;\;\color{blue}{70}^2-29\cdot\color{blue}{13}^2=-1$$

$$\big(U_{29}\big)^6=9801+1820\sqrt{29},\quad \text{thus}\;\;\color{blue}{9801}^2-29\cdot1820^2=1$$

$$2^6\left(\big(U_{29}\big)^6+\big(U_{29}\big)^{-6}\right)^2 =\color{blue}{396^4}$$

then we can see those integers all over the formula as,

$$\frac{2 \sqrt 2}{\color{blue}{9801}} \sum_{k=0}^\infty \frac{(4k)!}{k!^4} \frac{29\cdot\color{blue}{70\cdot13}\,k+1103}{\color{blue}{(396^4)}^k} = \frac{1}{\pi} $$

Nice, eh?

share|cite|improve this answer
what is this ?? – Aman Mittal Sep 26 '13 at 18:39
Its witchcraft... – Chris Sep 26 '13 at 19:15
Ramanujan used to say a goddess revealed those identities to him in dreams… – Luis Mendo Sep 26 '13 at 20:32
One needs to realize that $26390 =5 \times 7\times 13\times 58$ and $9801=99 \times 99$ and $396=4 \times99$. Then, it's obvious. ;-) – leonbloy Sep 27 '13 at 19:09
How is this formula not immediately obvious? – Mew Oct 2 '13 at 10:47

${1\over 2} < \left\lfloor \mathrm{mod}\left(\left\lfloor {y \over 17} \right\rfloor 2^{-17 \lfloor x \rfloor - \mathrm{mod}(\lfloor y\rfloor, 17)},2\right)\right\rfloor$

The above is the most interesting inequality in mathematics. If you plot it so that areas satisfying the inequality are shaded, this is what you get:

enter image description here

This is known as Tupper's self referential formula.

share|cite|improve this answer
This is really miraculous! – Gottfried Helms Sep 28 '13 at 11:51
@GottfriedHelms To be fair, a large portion of the miracle is hidden in the labelling of the $y$-axis. – Erick Wong Sep 28 '13 at 14:51
"The formula itself is a general purpose method of decoding a bitmap stored in the constant $k$, so it could actually be used to draw any other image. When applied to the unbounded positive range $0 \le y$, the formula tiles a vertical swath of the plane with a pattern that contains all possible 17-pixel-tall bitmaps. One horizontal slice of that infinite bitmap depicts the drawing formula itself, but this is not remarkable since other slices depict all other possible formulae that might fit in a 17-pixel-tall bitmap." (Wikipedia) – Vladimir Reshetnikov Sep 28 '13 at 20:18
I find this hardly miraculous at all, it's pure sensationalism :/ – Manishearth Sep 29 '13 at 12:11
Personally I find this one of the best answers here although it is not an identity nor equation (to be a bit picky I admit). But anyways, is there a self referential equation similar to this one? – TobiMcNamobi Sep 30 '13 at 8:25

$\mathrm{GCD}(F_{n},F_{m}) = F_{\mathrm{GCD}(n,m)}$ where $F_n$ is the $n$th Fibonacci number.

share|cite|improve this answer

Taken from the first question I posed upon joining M.SE:

Define a function $f(\alpha, \beta)$, $\alpha \in (-1,1)$, $\beta \in (-1,1)$ as

$$ f(\alpha, \beta) = \int_0^{\infty} dx \: \frac{x^{\alpha}}{1+2 x \cos{(\pi \beta)} + x^2}$$

You can use, for example, the Residue Theorem to show that

$$ f(\alpha, \beta) = \frac{\pi \sin{\pi \alpha \beta}}{ \sin{\pi \alpha} \sin{\pi \beta}} $$

Clearly, from this latter expression, $f(\alpha, \beta) = f(\beta, \alpha)$. But from where does such a symmetric result come? The integral itself does not lend itself to predicting any such symmetry so far as I (and many others so far) can see.

share|cite|improve this answer
Wow! The symmetry revealed here is beautiful... – Prism Sep 26 '13 at 20:53
Holy crap, this is my favourite! WHY? edit - whenever I see an interesting post, I look at the name and it's you again Ron! We have the same taste, that's for sure. – Bennett Gardiner Sep 28 '13 at 7:50
@BennettGardiner: you are too kind. Glad to see I am not alone in the world. – Ron Gordon Sep 28 '13 at 12:10

$$10^2+11^2+12^2=13^2+14^2$$ I found that one stunning.

P.S. In general, for $n>0$, the sum of $n+1$ consecutive squares starting with $x_1 = 2n^2+n$ is equal to $n$ consecutive squares starting with $y_1 = x_1+(n+1)$. Hence,

$$3^2+4^2 = 5^2$$


$$21^2+22^2+23^2+24^2 = 25^2+26^2+27^2$$

and so on.

share|cite|improve this answer
Stunning indeed. Because of $3^3+4^3+5^3=6^3$ (see other answer) can this be generalized even further? In the exponent? – TobiMcNamobi Sep 27 '13 at 8:24
9 – Utku Alhan Mar 19 '14 at 19:50
@UtkuAlhan haha, thanks, good one! – imranfat Mar 19 '14 at 20:02

$$\sum_{n=1}^\infty \frac{1}{n^2}=\frac{\pi^2}{6}$$

was surprising to me when I saw it for the first time.

share|cite|improve this answer
This is one of those times when you just have to accept Euler was a god among men. They had been trying to solve the sum of inverse squares for a very long time, and Euler just solved it matter-of-factly along with several other relations using roots of trigonometric taylor series and some simple substitutions. – DanielV Sep 27 '13 at 5:35
How did he find these series summations? I know they are trivial once you have Fourier decomposition, but to get them without having Fourier series... – finitud Nov 19 '13 at 14:46
@finitud There is a nice article on this in the book Journey through Genius: The Great Theorems of Mathematics, Chapter 9: The Extraordinary Sums of Leonhard Euler. If you search the chapter title you can find several references that essentially tells the same story. It's a great read (and not lengthy)! – Yong Hao Ng Feb 24 '14 at 10:41

$3^3 + 4^3 + 5^3 = 6^3$.


$1/89 = 0.01 + 0.001 + 0.0002 + 0.00003 + 0.000005 + 0.0000008 + 0.00000013 + \cdots$.

Let $S = \sum \frac{F_n} {k^n}$. Then $S + kS = 1 + \sum \frac{ F_{n} + F_{n-1} } {k^n} = 1 + \sum \frac {F_{n+1}}{k^n} = 1 + k^2S -1 - k$

In particular, for $k=10$, we get $ S = \frac{10}{89}$. Divide by 10 to get the second equation.

share|cite|improve this answer
+1 for the second one... wat? How does that even work? Does something similar work in other bases? – fhyve Sep 26 '13 at 3:00
@fhyve Yes it does. $\frac{F_n}{k^n}$ is rational, which can be shown in the normal way. – Calvin Lin Sep 26 '13 at 3:46
@CalvinLin I don't think that's the formula here, though... otherwise the last and second-to-last term above would have equal numbers of leading zeros. – user7530 Sep 26 '13 at 3:47
89 is also a Fibonacci number. – dust05 Sep 26 '13 at 4:27
The zeroes in your sum are off. It should be $...+0.00000013 + ...$. You have one too many. – Jack M Sep 26 '13 at 11:24

This is slightly contrived, but consider a situation where you have two balls, of mass $M$ and $m$, where $M=16\times100^N\times m$ for some integer $N$. The balls are placed against a wall as shown:

We push the heavy ball towards the lighter one and the wall. The balls are assumed to collide elastically with the wall and with each other. The smaller ball bounces off the larger ball, hits the wall and bounces back. At this point there are two possible solutions: the balls collide with each other infinitely many times until the larger ball reaches the wall (assume they have no size), or the collisions from the smaller ball eventually cause the larger ball to turn around and start heading in the other direction - away from the wall.

In fact, it is the second scenario which occurs: the larger ball eventually heads away from the wall. Denote by $p(N)$ the number of collisions between the two balls before the larger one changes direction, and gaze in astonishment at the values of $p(N)$ for various $N$:

\begin{align} p(0)&=3\\ p(1)&=31\\ p(2)&=314\\ p(3)&=3141\\ p(4)&=31415\\ p(5)&=314159\\ \end{align}

and so on. $p(N)$ is the first $N+1$ digits of $\pi$!

This can be made to work in other bases in the obvious way.

See 'Playing Pool with $\pi$' by Gregory Galperin.

share|cite|improve this answer
When the mass ratio gets large enough, the larger ball is going to have such a large radius that it will simply roll completely over the small ball.... unless you also allow infinite density, which I guess is a small gnat to swallow, given the camel of completely elastic collisions. – Ross Presser Sep 26 '13 at 18:22
It must also be assumed that the balls do not roll, but rather slide without friction. (Of course, the point-mass idealization takes care of that too.) – r.e.s. Sep 27 '13 at 13:53
As a rule of thumb, you will normally get less beautiful mathematical results if you start getting pedantic about what might be called real-world considerations. – Donkey_2009 Sep 27 '13 at 14:06
Can you do a sample calculation of p(4) please? – Neil Apr 6 '15 at 10:59

By far my favorite identity: $\displaystyle\int_{-\infty}^{\infty} \frac{\sin \left( x\right )}{x} \mathrm{d}x = \int_{-\infty}^{\infty} \frac{\sin ^ 2\left( x\right )}{x^2} \mathrm{d}x$

The fun part about this one (for me) is that it looks absolutely false at first glance. They both evaluate to $\pi$.

share|cite|improve this answer
+1 Oh gods, I can just imagine setting this as a question, and having students be frustrated with proving it via substitution. Let $x = y^2$ would be the start of most of their answers. – Calvin Lin Sep 27 '13 at 13:45
+1: Of course I wondered what the next powers would return and they returned all fractions of $\pi$ (starting with $p=1$) : $$1,1,\frac 34, \frac 23,\frac {115}{192},\frac {11}{10},\cdots$$ OEIS. – Raymond Manzoni Sep 29 '13 at 9:08
@RaymondManzoni Your last fraction is a typo: it should be $ 11 \over 20 $. – Mark Hurd Sep 30 '13 at 19:10
You are right @MarkHurd but I can't correct that. Btw the denominators are here. – Raymond Manzoni Sep 30 '13 at 20:19

Where $\varphi = \frac{1 + \sqrt{5}}{2}$ a golden ratio, $$\int_0^\infty\frac{1}{(1+x^\varphi)^\varphi}\mathrm dx = 1.$$

This follows immediately from the substitution $t=[x^{\varphi}(1+x^{\varphi})^{-1}]^{\varphi}$.

One more thing with golden ratio : by Ramanujan, $$r=\dfrac{e^{-2\pi/5}}{1 + \dfrac{e^{-2\pi}}{ 1 + \dfrac{e^{-4\pi}}{1 + \cdots}}} = \sqrt{ \sqrt{5}\varphi} - \varphi$$

and even more bizarrely (found based on the work of Vidunas), the hypergeometric function $N=\,_2F_1\big(\tfrac{19}{60},\tfrac{-1}{60},\tfrac{4}{5},1\big)$ is a deg-80 algebraic number given by,


share|cite|improve this answer
Just added one :) – filmor Sep 26 '13 at 11:59
Your second equation involves the Rogers-Ramanujan continued fraction (it's a rearrangement of Eq.19 at that link). The paper The Rogers-Ramanujan continued fraction, by Berndt et al (pp 2-3) says the first proof of that equation was by G. N. Watson, in his Theorems stated by Ramanujan (VII): Theorems on continued fractions, J. London Math. Soc. 4 (1929), 39–48. A more general result is proved in a paper by Kang. – r.e.s. Sep 27 '13 at 3:36
up vote 50 down vote


share|cite|improve this answer
This is the most unexpected identity I've seen in my life, and I would like to award the bounty to this answer. – Piotr Shatalin Oct 3 '13 at 18:04
In case you haven't seen this simplification of a similar Gamma ratio (admittedly with a simpler answer):… – Ron Gordon Oct 3 '13 at 18:29
Many thanks. Of course, one wonders how on earth your posted result is derived. – Ron Gordon Oct 3 '13 at 19:02
@RonGordon I wish it were my result, but actually it is from an amazing paper Raimundas Vidūnas, Expressions for values of the gamma function, which contains much more than that. – Vladimir Reshetnikov Oct 3 '13 at 19:10
Whoa! Now that is a paper! – Ron Gordon Oct 3 '13 at 19:18

If $A+B+C=180^\circ$ then $$\tan(A)+\tan(B)+\tan(C)=\tan(A)\tan(B)\tan(C)$$

share|cite|improve this answer

Here is a mathematical scherzo.

$$\left(\sum_{k=1}^n k\right)^2 = \sum_{k=1}^n k^3.$$

share|cite|improve this answer

$\displaystyle\sum_{k=1}^{24} k^2=70^2$ is novel.

share|cite|improve this answer
such a nontrivial pair (24, 70) is unique. – dust05 Sep 26 '13 at 3:52
It is also critical in the theory of the Leech lattice. See page 130, Theorem 4.5, in Lattices and Codes by Wolfgang Ebeling, second edition. Or see SPLAG, by Conway and Sloane, page 524 in Chapter 26, leading up to Theorem 3; chapter title Lorentzian Forms for the Leech Lattice. – Will Jagy Sep 26 '13 at 4:47
The cannonball problem. – Jon Claus Sep 26 '13 at 14:55

When I began my serious encounter with number theory and looked at properties of prominent combinatorical matrices I found this identity. This impressed me so much (even a bit philosophically) that I wanted to printed it on a t-shirt (but the white-on-black printing was then too expensive). The german phrase means "the exponential of the counting is the binomial"

Here is, how it looked asymptotically:


share|cite|improve this answer
Why on earth would you want that on a shirt? – Phaptitude Oct 22 '13 at 15:58
@Phap - well, why? Perhaps it was something, which I had myself discovered, and it had a much philosophical resembling: the human ability of counting, ... the step to the (otherwise) ubiquituous binomial numbers and the again ubiquituous exponential function - that was something really magic to me. – Gottfried Helms Oct 22 '13 at 17:28
@GottfriedHelms: So it won't be expensive, why not black print on a white shirt? :) – Tito Piezas III Jan 8 '14 at 5:50
Make a kickstarter and I will donate to help you fulfill your dream of having that shirt :) But don't be cheap with it also add in costs for matching pants, maybe a suit and a tie also :) – Neil Apr 6 '15 at 5:33

$$ {a \over b} = {c \over d} \quad\Longrightarrow\quad {a + b\over a - b} = {c + d \over c - d} $$

share|cite|improve this answer
I have to admit I was way too surprised when I learnt this simple identity. – Lazar Ljubenović Oct 13 '13 at 11:35
$\frac{a+b}{a-b}=\frac{a/b+1}{a/b-1}=\frac{c/d+1}{c/d-1}=\frac{c+d}{c-d}$ – Akiva Weinberger Aug 17 '15 at 20:12

Easy geometric series but I found this one charming when I found out:

1/7 = 0,142857...
    = 0,14 +
      0,0028 +
      0,000056 +
      0,00000112 +
      0,0000000224 + ... (double the value and shift it by two spaces)
share|cite|improve this answer
Quite generalizable, 7 * 14 = 100 - 2, therefore you start with 14, divide by 100 and multiply by 2. You could also use 7 * 143 = 1000 - -1 for an even simpler series. – aaaaaaaaaaaa Oct 2 '13 at 11:35

Do logic answers count? I like the Drinker Paradox, which isn't really a paradox but actually a theorem of logic:

$\exists x.\ [D(x) \rightarrow \forall y.\ D(y)]$

For every bar there is a person for whom, if that person is drinking, then everyone is drinking.

share|cite|improve this answer
I've seen this in the context of the Riemann Hypothesis: there exists a real number $c>0$ such that if $\zeta$ has no roots $\rho$ off of the critical line with $\vert \mathrm{Im} \rho \vert < c$, then the Riemann Hypothesis is true. – A Walker Sep 27 '13 at 5:22
@LukaMikec In every populated bar…? You can't very well say something is drinking. That just sounds creepy. – kojiro Sep 27 '13 at 15:13

$ \tan 10^\circ = \tan 20^\circ \times \tan 30^\circ \times \tan 40^\circ $.
$\tan 80^\circ = \tan 70^\circ \times \tan 60^\circ \times \tan 50^\circ $.

share|cite|improve this answer
That can be easily shown using $\tan 3x = \tan(60+x) \times \tan(x) \times \tan(60-x)$ – chubakueno Sep 30 '13 at 1:16

The square root of 2 is also the only real number other than 1 whose infinite tetrate is equal to its square...


share|cite|improve this answer
Hardly remarkable. It's just $2=\sqrt{2}^2$. – Sekots Nov 19 '13 at 2:47
Proof is pretty trivial: $m = {{x^x}^x}^{\dots}$. Then $x^m = m$ and $x = \sqrt[m]{m}$. So you could also say that $\sqrt[3]{3}$ is the only real number other than $1$ whose infinite tetrate is equal to its cube. – Soke Feb 26 '14 at 4:33

$$ \int_0^1 \frac{\ln(1+t^{4+\sqrt{15}})}{1+t}dt= -\frac{\pi^2}{12}(\sqrt{15}-2)+\ln 2\cdot \ln(\sqrt{3}+\sqrt{5})+\ln\frac{1+\sqrt{5}}{2}\cdot \ln(2+\sqrt{3}) $$

For references, see (there is a scan of a paper of Herglotz where it is proved).

share|cite|improve this answer
I don't get it: how is this striking? I must be missing something... – Jesse Madnick Sep 30 '13 at 6:30
How would one even approach such an integral? How does one evaluate integrals with quadratic irrationalities in the exponent? (Note that there is no formula for the same expression with arbitrary $p$ in place of $4+\sqrt{15}$). – Boris Bukh Sep 30 '13 at 13:18
This is an amazing integral! Are there other real non-rational algebraic exponents such that the integral can be expressed in an elementary closed form? – Piotr Shatalin Oct 3 '13 at 18:08


share|cite|improve this answer

$$\int_{0}^{1}\sin{(\pi x)}x^x(1-x)^{1-x}dx=\dfrac{\pi e}{4!}$$

share|cite|improve this answer
I'm not too surprised that this would come out to something like that (though I would never guess that in particular). It is a fairly complicated integral, it seems like it was specifically crafted to evaluate to a certain value – fhyve Sep 26 '13 at 2:58
It would be more attractive if you wrote $4!$ instead of $24$ – zerosofthezeta Sep 26 '13 at 5:19
This doesn't strike me as remarkable at all. The $\pi$ probably comes from the $\sin$, the $e$ probably comes from the $x^x$. – Jack M Sep 26 '13 at 11:27

I find this identity due to Euler particularly striking (and not obvious at all): $$\prod_{n=1}^\infty (1-x^n) = \sum_{k=-\infty}^\infty (-1)^k\,x^{p(k)}$$

where the $p(k) = \dfrac{k(3k-1)}{2}$ are the generalized pentagonal numbers. This is what these numbers look like us for $1 \leq k \leq 5$, First pentagonal numbers

[image created by Aldoaldoz]

share|cite|improve this answer
Euler formula for partition function $p(k)=\sum_{d=1}^{\infty}(-1)^{d+1}\left(p\left(k-\frac{d(3d-1)}{2}\right)+ p\left(k-\frac{d(3d+1)}{2}\right)\right)$ – Adi Dani Sep 28 '13 at 13:00
I think the RHS is prettier if you write it as $1-x^1-x^2+x^{2+3}+x^{3+4}-x^{3+4+5}-x^{4+5+6}+x^{4+5+6+7}+\cdots$ – bof Sep 30 '13 at 5:25

$$ \begin{align}\frac{\pi}{4} = 4 \arctan \frac{1}{5} - \arctan \frac{1}{239} \\\,\\\,\\ \frac{\pi}{4} = 5 \arctan \frac{1}{7} + 2 \arctan \frac{3}{79}\end{align}$$

Both can be shown easily using polar form, complex multiplication.

share|cite|improve this answer

$3^3 + 4^4 + 3^3 + 5^5 = 3435$

$1^1=1$ is the only other such number.

share|cite|improve this answer

Some zeta-identies have been much surprising to me.

Let's denote the value $\zeta(s)-1$ as $\zeta_1(s)$ then $$ \small \begin{array} {} 1 \zeta_1(2) &+&1 \zeta_1(3)&+&1 \zeta_1(4)&+&1 \zeta_1(5)&+& ... &=&1\\ 1 \zeta_1(2) &+&2 \zeta_1(3)&+&3 \zeta_1(4)&+&4 \zeta_1(5)&+& ... &=&\zeta(2)\\ & &1 \zeta_1(3)&+&3 \zeta_1(4)&+&6 \zeta_1(5)&+& ... &=&\zeta(3)\\ & & & &1 \zeta_1(4)&+&4 \zeta_1(5)&+& ... &=&\zeta(4)\\ & & & & & &1 \zeta_1(5)&+& ... &=&\zeta(5)\\ ... & & & & & & & &... &= & ... \end{array} $$ There are very similar stunning alternating-series relations:

$$ \small \begin{array} {} 1 \zeta_1(2) &-&1 \zeta_1(3)&+&1 \zeta_1(4)&-&1 \zeta_1(5)&+& ... &=&1/2\\ & &2 \zeta_1(3)&-&3 \zeta_1(4)&+&4 \zeta_1(5)&-& ... &=&1/4\\ & & & &3 \zeta_1(4)&-&6 \zeta_1(5)&+& ... &=&1/8\\ & & & & & &4 \zeta_1(5)&-& ... &=&1/16\\ ... & & & & & & & &... &= & ... \end{array} $$

share|cite|improve this answer

Tetration :

consider the tower of taking infinite powers : $x^{x^{x^{x^{x^{x^{x^{.{^{.^{.}}}}}}}}}}$ .

At first its seems big mystery and undefined one for lots of real numbers.

Surprising fact is its indeed converges in an closed interval which is bounded by the fancy real numbers $e^{-e}$, $e^\frac{1}{e}$

So $x^{x^{x^{x^{x^{x^{x^{.{^{.^{.}}}}}}}}}}$ converges for $ x \in [e^{-e}, e^\frac{1}{e} ] $

share|cite|improve this answer

protected by Zev Chonoles Sep 27 '13 at 7:46

Thank you for your interest in this question. Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site.

Would you like to answer one of these unanswered questions instead?

Not the answer you're looking for? Browse other questions tagged or ask your own question.