# Collection of surprising identities and equations.

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.

• I really can't believe no one has posted this yet: xkcd.com/687 Commented Sep 26, 2013 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. Commented Sep 26, 2013 at 19:48
• Pi seconds is a nanocentury! Commented Oct 1, 2013 at 21:59
• The three trigonometric identities in the following exercises of my Wikibook: en.wikibooks.org/wiki/On_2D_Inverse_Problems/…
– DVD
Commented Oct 12, 2015 at 2:51
• This shouldn't be closed. There are still so many nice equations.In spherical trigonometry $$\frac{sin(A)}{sin(a)}=\frac{sin(B)}{sin(b)}=\frac{sin(B)}{sin(b)}$$ where the capital letters are the angles and lowercase are the opposite sides.
– skan
Commented Nov 26, 2016 at 17:12

$$\sum_{i=0}^N {{N}\choose{i}}=2^N$$

• No, I'm not. And why is this surprising? Commented Dec 28, 2019 at 10:05

$$\sum_{k=-\infty}^\infty 2^k = 0$$ as can be shown from the regularization $\sum\limits_{k=1}^\infty 2^k=-1$. I'm wondering whether this is not actually the case for all ("sensible") two-sided regularizations, see here

Too explain this sum, note how for $|q|<1$ the geometric series $1+q+q^2+...$ converges to $\frac1{1-q}$. This works fine for the negative powers of two, i.e. $q=\frac12$ such that $\sum\limits_{k=-\infty}^02^k=\sum\limits_{k=0}^\infty\left(\frac12\right)^k=2$. Regularization now basically consists of stating "Ok, outside the convergence region (the positive powers of two in this case) just claim $1+q+q^2+...$ is still "equal" to $\frac1{1-q}$", i.e. $\sum\limits_{k=0}^\infty 2^k "=" \frac1{1-2}=-1$. Subtract the $1=2^0$ counted twice from these two sums to get above result.

We Theoretical Physicists tend to do things like this regularly, which mostly means we were too eager on swapping $\lim$s at some point before ;)

• How can the sum from 1 to infinity of positive integers lead to a negative number? Commented Sep 28, 2013 at 2:27
• @Chris Because it isn't a sum in the normal sense. It's a regularized divergence. Commented Sep 28, 2013 at 5:48
• @Chris Sorry for the brevity, I expanded a bit on this Commented Sep 28, 2013 at 7:22
• @Chris You need to review the "allowable" operations on summations. SumToInfinity(F(X)) is not the same as F(0) + F(1) + F(2) + ..., otherwise you'd have paradoxes even in convergent sums due to the fact that you can arbitrary choose the order of which terms to sum. Commented Sep 28, 2013 at 14:11
• The Casimir effect needs a trick like that. Commented Sep 29, 2013 at 9:52

The infinite Fibonacci sequence $F = (0, 1, 1, 2, 3, 5, 8, \dots)$ and the infinite Fibonacci string $S = 1011010110110 \dots$ are related by the following remarkable identity for all real or complex $\beta$ such that $\ |\beta| > 1$:

$$[0 \ ; \ \beta^{F_0}, \beta^{F_1}, \beta^{F_2}, \dots] = (\beta - 1) \cdot (0.S)_\beta$$

where $[0 \ ; \ \beta^{F_0}, \beta^{F_1}, \beta^{F_2}, \dots]$ denotes the continued fraction

$$\frac{1}{\beta^{F_0} + \frac{1}{\beta^{F_1} + \frac{1}{\beta^{F_2} + \cdots}}}$$

and $(0.S)_\beta = (0.1011010110110 \dots)_\beta$ denotes the number obtained by reading $0.S$ as a "base-$\beta$ numeral"; that is, $(0.S)_\beta$ denotes the sum of the infinite series

$$S[1] \beta^{-1} + S[2]\beta^{-2} + S[3]\beta^{-3} + \cdots$$

where $S[n]$ is the $n$th element of string $S$.

E.g., the so-called rabbit constant $(0.S)_2$ = 0.709803... in decimal , $(0.S)_\pi$ = 0.362011... in decimal, etc.

($F$ and $S$ are also related by the fact that both are generated by recursions of the form $x_{n+1} = x_{n} + x_{n-1} ;\ x_0 = 0, \ x_1 = 1$, where the $+$ is interpreted in one case as arithmetic addition, and in the other case as string concatenation.)

I know it's incredibly simple, but I'm always awed by $$2+2 = 2 \cdot 2 = 2^2 = \;^2 2.$$ Two is where addition, multiplication and exponentiation meet. And: tetration.

• That extends beyond exponentiation, as well, in the sense that 2 op 2 has the same value for every binary operation op in Goodstein's infinite sequence of hyperoperations (+, *, ↑, ↑↑, ↑↑↑, ...). Commented Sep 27, 2013 at 4:23
• @r.e.s. Can you explain that? Isn't 2 ↑↑ 2 = 16 ? Commented Sep 28, 2013 at 0:04
• @MrZander For any op beyond addition, in the expression x op y the y specifies how many x's are to be "combined" using the hyperoperator at the next lower level. E.g., 2↑↑4 = 2↑2↑2↑2 = 2↑2↑4 = 2↑16 = 65536, 2↑↑3 = 2↑2↑2 = 2↑4 = 16, 2↑↑2 = 2↑2 = 4. Commented Sep 28, 2013 at 3:57
• If you look at "generalized commutative hyperoperations" one can find an approach by A. Bennet in the 1910'th to define operations on an fractional index between "+" (=index 0) and "*" (=index 1). In this spirit using base $b=\sqrt 2$ instead of Bennet's $\exp()$ and $\log()$ to base $e$ all fractional indexed commutative operations between "+", "*", "^" and so on have the property that $x+y$ which is also $x \circ_0 y$ and all $x \circ_k y$ equal $x+y = x \circ_k y = x \cdot y = ...$ See the example "multiplication-table" at math.stackexchange.com/a/1272791/1714 Commented Jan 21, 2019 at 0:31
• This has to do with the fact that these are binary operations. Commented Dec 28, 2019 at 10:15

Given a polynomial $p(x)$ of degree $n$, let $a$ be the leading coefficient. Then:

$$\sum_{k=0}^n (-1)^k{n\choose k}p(x-k)=an!$$

This happens to be equivalent to:

$$p^{(n)}(x)=an!$$

where $p^{(k)}$ is the $k$th derivative of $p(x)$.

The surprising part is that the sum can actually obtain the leading coefficient without any remaining reference to the polynomial aside from the factorial of the degree.

• An instance of the binomial transform which, together with its inversion, form a nice couple of formulas. Commented Oct 26, 2015 at 17:39

This one really surprised me: $$\int_0^{\pi/2}\frac{dx}{1+\tan^n(x)}=\frac{\pi}{4}$$

• +1 Nice one! Easily proved using $$\int_a^bf(x)~dx=\int_a^bf(a+b-x)~dx$$ and adding. Commented Jun 13, 2021 at 8:45

$y(x)=\left \{ \frac{x- \frac {\left \lceil \frac {\sqrt {1+8x}-1} {2} \right \rceil \left ( 1-\left \lceil \frac {\sqrt {1+8x}-1} {2} \right \rceil \mod2 \right)} {2}} {\left \lceil \frac {\sqrt {1+8x}-1} {2} \right \rceil}\right \}$

This function has the following slopes: 1 at [0,1), 2 at [1,3) and so on

• can you tell me, where you have find this? Commented Nov 19, 2013 at 10:27

Let $p_n$ be the probability that a random permutation in the symmetric group $S_n$ doesn't have fixed points. Then $\lim_{n\to\infty}p_n=\frac{1}{e}$.

I was amazed the first time I saw this exercise!

• No big surprise. This is just an application of the inclusion-exclusion formula and $\displaystyle{e^x=\sum_{n\geq0}\frac{x^n}{n!}}$ Commented Oct 19, 2013 at 12:44
• Of course that's how it's proven, but it's still surprising when you first see it! Many of the facts on this post are easy and not surprising once you know what's going on behind the scenes! Commented Oct 19, 2013 at 18:14

It's funny noone mentioned the hockey-stick identity, partial sum of columns in a Pascal triangle:

$$\sum_{k=0}^{m}\binom{n+k}{k}=\binom{n+m+1}{n}$$

http://www.artofproblemsolving.com/Wiki/index.php/Combinatorial_identity

• Is not this what is called Vandermonde's identity? Commented Dec 28, 2019 at 10:19

Plot the graphs of the functions $$f(x)=\dfrac{2(x^2+|x|-6)}{3(x^2+|x|+2)}+\sqrt{16-x^2}$$ and $$g(x)=\dfrac{2(x^2+|x|-6)}{3(x^2+|x|+2)}-\sqrt{16-x^2}$$ in $x\in[-4,4]$ on the same plane.

• I made this one on valentine's day: desmos.com/calculator/xzwffxyucr Commented Mar 20, 2017 at 23:47
• Very nice picture. There is another two functions those make a similar picture: $$y=|x|^{3/2}\pm\sqrt{1-x^2}.$$ May be you can add more components to make this more nice :) Commented Mar 22, 2017 at 5:19

$$\sin \pi x=\pi x\prod_{n=1}^{\infty}\left(1-\frac {x^2}{n^2}\right).\quad \text {(L. Euler).}$$ Obviously the LHS and RHS have the same set of zeroes but that alone does not imply equality. And putting $x=1/2$ into it, we derive the Wallis product for $\pi,$ which itself is remarkable, especially as Wallis was Newton's immediate predecessor in the "Lucas chair" and obtained his product without the full generality of the methods of calculus developed by Newton..

$$\sum_{n=1}^{+\infty}\frac{\mu(n)}{n}=1-\frac12-\frac13-\frac15+\frac16-\frac17+\frac1{10}-\frac1{11}-\frac1{13}+\frac1{14}+\frac1{15}-\cdots=0$$ This relation was discovered by Euler in 1748 (before Riemann's studies on the $$\zeta$$ function as a complex variable function, from which this relation becomes much more easier!).

Another notable relation is the following, on the partition function, due to Ramanujan: $$p(n)=\frac1{\pi\sqrt2}\sum_{k=1}^{N}\sqrt k\left(\sum_{h\mod k}\omega_{h,k}e^{-2\pi i\frac{hn}{k}}\right)\frac d{dn}\left(\frac{\cosh\left(\frac{\pi\sqrt{n-\frac1{24}}}{k}\sqrt{\frac23}\right)-1}{\sqrt{n-\frac1{24}}}\right)+O\left(n^{-\frac14}\right)\;.$$ Then one of the most impressive formulas is the functional equation for the $$\zeta$$ function, in its asimmetric form: it highlights a very very deep and smart connection between the $$\Gamma$$ and the $$\zeta$$: $$\pi^{-\frac s2}\Gamma\left(\frac s2\right)\zeta(s)= \pi^{-\frac{1-s}2}\Gamma\left(\frac{1-s}2\right)\zeta(1-s)\;\;\;\forall s\in\mathbb C\;.$$

• There must be a typo in the last expression, it should be $\pi^{\frac{1-s}2}\Gamma\left(\tfrac s2\right)\zeta(s)= \pi^{\frac s2}\Gamma\left(\tfrac{1-s}2\right) \zeta(1-s)\;\;\;\forall s\in\mathbb C$. Commented Dec 28, 2019 at 14:26

If $$x^{x} = x+1$$, then

$$x^{x^2+x} = (x^2+x)^{x}$$

Something I recently saw on Abstruse Goose (although I don't recall the exact link).

$$10^2+11^2+12^2=13^2+14^2$$

Moreover, one can easily prove that this is the only sequence of five consecutive positive numbers which have this property!

• Nice! How would you prove your last claim? Commented Sep 29, 2013 at 9:02
• @rbm: Simplify and solve the polynomial equation: $$(x-1)^2+x^2+(x+1)^2=(x+2)^2+(x+3)^2$$ Commented Sep 29, 2013 at 9:04
• Ah that's clever. Thanks Commented Sep 29, 2013 at 9:06
• math.stackexchange.com/a/505421 Commented May 29, 2021 at 3:50

The continued fraction of The Golden Ratio:

$\frac{1+\sqrt5}{2}=[1;,1,1,1,\dots]=[1,\bar1]$

Also: $\frac{1+\sqrt5}{2}=\sqrt{1+\sqrt{1+\sqrt{1+\dots}}}$.

$${\large\sqrt{\vphantom{\Large A}\,\color{#ff0000}{20}\color{#0000ff}{25}\,}\, = 45 = \color{#ff0000}{20} + \color{#0000ff}{25}}$$

• Oh come on, we can do better than that: $$\sqrt{3025}=30+25$$ $$\sqrt{99801}=998+1$$ $$\sqrt{4941729}=494+1729$$ $$\sqrt{7441984}=744+1984$$ $$\sqrt{52881984}=5288+1984$$ $$\sqrt{60481729}=6048+1729$$ Commented Dec 1, 2018 at 17:53
• @Frpzzd It's quite fine there are so many cases. However, your second example is wrong because $\displaystyle 999^2 = 998001 \not= 99801$. My ONLY example appears in the book "The Man who Counted". Commented Dec 3, 2018 at 20:40

I'm a fan of approximations, and I ran into this one the other day:

$$\Gamma^{(k)}(1) \sim (-1)^k\, \Gamma(k+1) \quad \text{as } k \to \infty.$$

The form is interesting in that it relates the $k^\text{th}$ derivative of the function at $1$ to the value of the function at $k+1$.

The approximation isn't too bad either; the relative error is on the order of $2^{-k}$, i.e.

$$\Gamma^{(k)}(1) = (-1)^k\, \Gamma(k+1) \left[1 + O\!\left(2^{-k}\right)\right] \quad \text{as } k \to \infty.$$

One more with continued fractions. In 2003 there was a discussion in sci.math about the continued fractions of powers of $e$ - if I recall correctly, then that of even powers are somehow folklore. But examining the pattern to the depth we came to the following infinite continued fraction with a variable parameter: $$\operatorname{cfe}(x)= [1,\tfrac1x-1,1, \quad 1,\tfrac3x-1,1, \quad 1,\tfrac5x-1,1, \quad \ldots ]$$ where the pattern is easily recognizable.
Then "generalize" the continued fraction and allow irrational values for $x$. Then

$$x = \operatorname{cfe}( \ln(x) ) \qquad \qquad x \ne 1$$ or $$x= 1+\cfrac{1} {(\tfrac1{\ln x}-1) + \cfrac{1} {1+\cfrac{1} {1+\cfrac{1} {(\tfrac3{\ln x}-1) + \cfrac{1} {1+\cfrac{1} {1+\cfrac{1} {(\tfrac5{\ln x}-1) + \cfrac{1} {1+\cfrac{1} {...}}}} }}}}}$$

$$\int_0^{\frac{\pi}{2}} x\ln(\tan(x))\ dx=\frac{7}{8}\zeta(3)$$

I apologize if this is already here. I thought it was but I can't find it, so I must have seen it somewhere else on the site.

$$\begin{matrix} f(x) & \displaystyle\int f(x)dx \\[6pt] \hline x^2 & \dfrac{x^3}{3} \\[6pt] x & \dfrac{x^2}{2} \\[6pt] 1 & x \\[6pt] \dfrac{1}{x} & \color{red}{\log(x)} \\[6pt] \dfrac{1}{x^2} & -\dfrac{1}{x} \\[6pt] \dfrac{1}{x^3} & -\dfrac{1}{2x^2} \\[6pt] \dfrac{1}{x^4} & -\dfrac{1}{3x^3} \end{matrix}$$

$\displaystyle{\int x^n dx} = \frac{x^{n+1}}{n+1}$

$\displaystyle{\lim_{n \rightarrow -1} \left(\frac{x^{n+1}}{n+1}\right)} = \log(x)$?

No. Let $g(x,n)=\frac{x^{n+1}}{n+1}$.

For $x\in(0,\infty)$, you have:
$g(x,n)>0$ as $n\rightarrow -1$ from above, and
$g(x,n)<0$ as $n\rightarrow -1$ from below, but
$\log(x)<0$ on $x\in(0,1)$ and $\log(x)>0$ on $x\in(1,\infty)$.

I wish I understood this better.

• $\frac{x^{n+1}}{n+1}$ actually approaches $\log(x) + \gamma - \zeta(-n)$ as $n \rightarrow -1$. $\gamma$ is Euler's constant. Commented Nov 21, 2021 at 22:13
• @HayashiYoshiaki How so? Assuming $x>0$, I'm pretty sure that ${\lim_{n\to {-1}^{+}}{\frac{x^{n+1}}{n+1}}=\infty}$ and ${\lim_{n\to {-1}^{-}}{\frac{x^{n+1}}{n+1}}=-\infty}$. Commented Sep 1, 2022 at 15:37
• Yes, but what goes infinity is the constant of integration $C$ and the function itself approaches log(x). The relation you've shown requires a "proper" constant of integration $\gamma - \zeta(-n)$. Very interesting. Commented Sep 2, 2022 at 16:40

$$\frac{11}{10}\cdot\frac{1111}{1110}\cdot\frac{111111}{111110}\cdot\frac{11111111}{11111110}\cdots =1.101001000100001000001\cdots$$

I got this integral,

$$\int_{-\infty}^{+\infty}\frac{\mathrm dt}{(\phi^n t)^2+\pi^2(F_{2n+1}-\phi F_{2n})(e^{\gamma}t^2+t-1)^2}=1$$

Where $$F_{n}$$ is the Fibonacci number,$$\phi$$ is the Golden ratio and $$\gamma$$ is the Euler's constant.

Let me add my personal favorite one here:

$$\sum_{\substack{m, n \geq 1\\\gcd(m,n)=1}} \frac{1}{m^2n^2}=\frac{5}{2}.$$

You can generalize this into $$\mathop{\sum_{n_1=1}^\infty\cdots\sum_{n_j=1}^\infty}\limits_{(n_1,\dots,n_j)=1} \frac1{n_1^{k_1} \cdots n_j^{k_j}}=\frac{\zeta(k_1)\zeta(k_2)\cdots \zeta(k_n) }{\zeta(k_1+k_2+\cdots+k_n)},$$ where $$\zeta$$ is the Riemann's zeta function.

I think this is simple but I want to post it:

$$1 \times 9=9\implies(0+9=9)$$ $$2\times 9=18\implies(1+8=9)$$ $$3\times 9=27\implies(2+7=9)$$ $$4\times 9=36\implies(3+6=9)$$ $$5\times 9=45\implies(4+5=9)$$ $$6\times 9=54\implies(5+4=9)$$ $$7\times 9=63\implies(6+3=9)$$ $$8\times 9=72\implies(7+2=9)$$ $$9\times 9=81\implies(8+1=9)$$ $$10\times 9=90\implies(9+0=9)$$ and also no. are in a pattern $09,18,27,36,45\;$then reverse the no.$54,63,72,81,90$

• I used this to help me learn my $9$ times tables back in Grade 2 Commented Feb 28, 2014 at 2:28

This formula thrills me and stirs my mind as nothing could for years... $$\int^\infty_{0}\!\!e^{-3\pi x^2}\frac{\sinh(\pi x)}{\sinh(3 \pi x)}\,dx=\frac{1}{e^{2\pi/3}\cdot \sqrt3} \sum^\infty_{n=0}\frac{e^{-2n(n+1)\pi}}{(1+e^{-\pi})^{2}(1+e^{-3\pi})^{2}\cdots(1+e^{-(2n+1)\pi})^{2}}$$

• Can I ask why this one in particular? Commented Sep 28, 2013 at 8:05
• @BennettGardiner This formula consists of A combination of irrational constants , trigonometric function and more over a connection of an infinite sum and infinite integral. Commented Sep 28, 2013 at 12:30
• Note that $\sinh(x) = \frac 12 (\mathrm e^x - \mathrm e^{-x})$, so in fact you have "only" a combination of exponential functions under the integral. And it would be more impressive if the RHS was missing the $\pi$. Commented Sep 30, 2013 at 13:15

The most interesting identity I have come across so far is the Mellin Transform of Gauss' Hypergeometric Function with a negative $$x$$-argument which can be expressed as a combination of Beta and Gamma Functions

$$\mathcal{M}[_2F_1(a,b;c;-x)](s)=B(s,a-s)\frac{\Gamma(b-s)\Gamma(c)}{\Gamma(b)\Gamma(c-s)}$$

which again points out the extremely close relation between all these special functions in general.

I believe McShane's identity is very surprising, and is pretty different from the rest of these answers.

Let $$\Sigma_{1,1}$$ be a once punctured torus with a complete, finite volume, hyperbolic metric $$g$$. Let $$C$$ be the set of closed geodesic curves which do not intersect themselves (simple closed curves). Then we have the following identity:

$$\sum_{c \in C} \frac{1}{1+e^{\mathrm{length}(c)}}=\frac{1}{2}.$$

This is extremely interesting because there are many such metrics up to isometry. In fact the space of such metrics is naturally isomorphic to the modular curve $$\mathbb H^2/ \mathrm{PSL}(2,\mathbb{Z})$$. In general the set of lengths of simple closed curves will be very different for different metrics. For example, for any $$\epsilon >0$$ you can find a metric with a $$c \in C$$ of that length. When $$\epsilon$$ is small the corresponding term is very close to $$1/2$$. There are also metrics where every curve in $$C$$ has length greater than 1.

This identity, and generalizations of this, end up being related to important work by Maryam Mirzakhani, who won the Fields medal.

This expression is from Francois Viète: $$\pi = \frac{2}{1} \times \frac{2}{\sqrt2} \times \frac{2}{\sqrt{2+\sqrt2}}\times \frac {2}{\sqrt{2+\sqrt{2+\sqrt2}}} \times \cdots$$

A fun one from probability: If $$U, V, W$$ are independent random variables, each uniform on $$(0,1)$$, then $$(UV)^W$$ is also uniform on $$(0,1)$$.

An impressive relationship connecting three important functions in number theory $$\sigma(n)+ \phi(n) = n \cdot d(n) \qquad \text{for } n \in \mathbb P$$ $$\sigma(n)$$ - sum of positive divisors of n

$$\phi(n)$$ - Euler's totient function

$$d(n)$$ - number of positive divisors of n

• I don't understand. $\sigma(6) + \phi(6) = 6 + 2 = 8 \neq 18 = 6\cdot3 = 6\cdot d(6)$ Commented Dec 28, 2019 at 0:09
• @Oscar, you are absolutely right. I totally forgot to mention, that the equation is true iff n is a prime number. Commented Dec 28, 2019 at 19:03