Examples and counterexamples in mathematics/Infinite sequences

296280 more-or-less notable sequences are collected on The On-Line Encyclopedia of Integer Sequences. See also mathigon, mathsisfun etc.

A sequence of equal members
(0,0,0,0,...)

Unlike a set, a sequence may contain nothing but zero and still be infinite. That is, all members (in other words, elements or terms) of a sequence may be equal to 0; or, say, to 71, if you prefer: (71,71,71,71,...).

The sequence of natural numbers
(1,2,3,...)

The n-th member is equal to n.

This sequence is strictly increasing (that is, each member is less than the next member).

The odd subsequence (1,3,5,...) contains all odd natural numbers; the even subsequence (2,4,6,...) contains all even natural numbers. More generally, for every sequence $$(a_1,a_2,a_3,\dots)$$ one may consider its odd subsequence $$(a_1,a_3,a_5,\dots)$$ and even subsequence $$(a_2,a_4,a_6,\dots).$$

All integers in a sequence
(0,1,-1,2,-2,...)

Existence of such sequence shows that the set of all integers (including negative) is countable.

This sequence is non-monotone (that is, neither increasing nor decreasing). All integers cannot be contained in a monotone sequence, since an increasing sequence is bounded from below, and a decreasing sequence is bounded from above (think, why).

The n-th member is equal to
 * $$\begin{cases} -(n-1)/2 &\text{for odd } n,\\ n/2 &\text{for even } n.\end{cases}$$

Just for fun, these two formulas may be combined,
 * $$\frac{1+(-1)^n(2n-1)}4,$$

but this is not required. Two (and more) formulas are a legitimate way to define a sequence. More generally, any two sequences $$(a_1,a_2,\dots)$$ and $$(b_1,b_2,\dots)$$ may be interspersed into a single sequence $$(c_1,c_2,\dots)=(a_1,b_1,a_2,b_2,\dots);$$ here
 * $$c_n = \begin{cases} a_{(n+1)/2} &\text{for odd } n,\\ b_{n/2} &\text{for even } n.\end{cases}$$

The odd subsequence $$(c_1,c_3,c_5,\dots)$$ of the new sequence $$(c_1,c_2,\dots)$$ is equal to the first sequence $$(a_1,a_2,\dots);$$ similarly, the even subsequence $$(c_2,c_4,c_6,\dots)$$ equals $$(b_1,b_2,\dots).$$

A sequence containing every natural number infinitely many times
(1,2,1,3,1,2,1,4,1,2,1,3,1,2,1,5,1,2,...)

The odd subsequence (1,1,1,...) contains only 1. The even subsequence (2,3,2,4,2,3,2,5,2,...) differs from the whole sequence only by 1 added to every member. Thus, the odd subsequence of the even subsequence contains only 2. And so on... That is, denoting n-th member by $$a_n,$$ we have $$a_{2n}=a_n+1.$$

The n-th member is equal to the number q such that $$\frac n{2^{q-1}}$$ is an odd integer. Thus, $$\frac n{2^{q-1}}=2p-1$$ for some integer p. Using this p instead of q we get another sequence containing every natural number infinitely many times: (1,1,2,1,3,2,4,1,5,3,6,2,7,4,...) The odd subsequence is just (1,2,3,...). The even subsequence (1,1,2,1,3,2,4,...) is equal to the whole sequence. That is, denoting n-th member by $$b_n,$$ we have $$b_{2n}=b_n.$$

In contrast, a monotone sequence cannot contain both 1 and 2 infinitely many times (think, why).

All positive rationals in a sequence
$$\textstyle\Big(1,\frac12,2,\frac13,3,1,4,\frac14,5,\frac32,6,\frac23,\dots\Big)$$

The n-th member is equal to $$\frac p q$$ for positive integers p, q such that $$n=(2p-1)\cdot 2^{q-1}.$$ That is, $$a_{(2p-1)\cdot 2^{q-1}}=\frac p q.$$ Thus, $$\textstyle a_1=a_{1\cdot2^0}=a_{(2\cdot1-1)\cdot 2^{1-1}}=\frac11=1;$$ $$\textstyle a_2=a_{1\cdot2^1}=a_{(2\cdot1-1)\cdot 2^{2-1}}=\frac12;$$ $$\textstyle a_3=a_{3\cdot2^0}=a_{(2\cdot2-1)\cdot 2^{1-1}}=\frac21=2;$$ $$\textstyle a_4=a_{1\cdot2^2}=a_{(2\cdot1-1)\cdot 2^{3-1}}=\frac13;$$ $$\textstyle a_5=a_{5\cdot2^0}=a_{(2\cdot3-1)\cdot 2^{1-1}}=\frac31=3;$$ $$\textstyle a_6=a_{3\cdot2^1}=a_{(2\cdot2-1)\cdot 2^{2-1}}=\frac22=1;$$ and so on. Every positive rational number $$\frac p q$$ appears in this sequence as n-th member $$a_n$$ for $$n=(2p-1)\cdot 2^{q-1}.$$

Existence of such sequence shows that the set of all positive rational numbers is countable.

And moreover, $$\frac p q$$ appears infinitely many times, not only for $$n=(2p-1)\cdot 2^{q-1},$$ but also for $$n=(4p-1)\cdot 2^{2q-1},$$ $$n=(6p-1)\cdot 2^{3q-1}$$ and so on.

Every number is an accumulation point of this sequence (that is, every neighborhood of the given number contains infinitely many members of the sequence; equivalently, the given number is the limit of some subsequence). In contrast, a monotone sequence may have only one accumulation point, namely, the limit of the whole sequence (think, why).

The function f defined by $$f(q-1,p-1)+1=(2p-1)\cdot 2^{q-1}$$ for integer $$p,q>0,$$ that is, $$f(x,y)=(2y+1)\cdot 2^x -1$$ for integer $$x,y\ge0,$$ is an example of the so-called pairing function.

Factorials
(1,2,6,24,120,720,...)

The n-th member is equal n times the (n-1)-th member: $$a_n=na_{n-1}$$ for all $$n>1.$$ This is a so-called recurrence relation: each further member is defined as a function of its number and the preceding member.

And the first member is equal to one: $$a_1=1.$$ Thus, the n-th member is the product of all natural numbers from 1 to n; it is called the factorial of n and denoted by $$n!\,.$$ For instance, $$5! = 1\cdot2\cdot3\cdot4\cdot5 = 120.$$

Factorials are widely used. They appear in the binomial theorem, Taylor's theorem, most of well-known discrete probability distributions (binomial, negative binomial, multinomial, Poisson, hypergeometric) etc.

A wonderful approximation for large factorials is given by Stirling's formula $$\textstyle n! \sim \sqrt{2 \pi n} \, n^n e^{-n}.$$ Its relative error $$\textstyle \big| 1 - \frac{\sqrt{2 \pi n} \, n^n e^{-n}}{n!} \big|$$ tends to zero (as n tends to infinity), but the absolute error $$|n!-\sqrt{2 \pi n} \, n^n e^{-n}|$$ tends to infinity.

Fibonacci numbers
(1,1,2,3,5,8,13,21,...)

The n-th member is equal the (n-1)-th member plus the (n-2)-th member: $$a_n=a_{n-1}+a_{n-2}$$ for all $$n>2$$ (a recurrence relation, again). And the first two members are equal to one: $$a_1=a_2=1.$$ Thus, $$a_3=a_2+a_1=1+1=2;$$ $$a_4=a_3+a_2=2+1=3;$$ $$a_5=a_4+a_3=3+2=5;$$ and so on.

In the 17th century Johannes Kepler observed that ratios of consecutive Fibonacci numbers $$\textstyle \big( \frac11, \frac21, \frac32, \frac53, \dots \big)$$ converge to a limit: $$\tfrac{a_{n+1}}{a_n} \to \varphi$$ (as $$n\to\infty$$) for some number $$\varphi.$$ If so, then necessarily $$\tfrac{a_{n+2}}{a_{n+1}} \to \varphi,$$ therefore $$\tfrac{a_{n+1}+a_n}{a_{n+1}} \to \varphi,$$ that is, $$1+\tfrac{a_n}{a_{n+1}} \to \varphi;$$ taking into account that $$\tfrac{a_n}{a_{n+1}} \to \tfrac1\varphi$$ we get $$1+\tfrac1\varphi = \varphi,$$ that is, $$\varphi+1=\varphi^2;$$ a quadratic equation on $$\varphi.$$ It has two roots, $$(1\pm\sqrt5)/2,$$ one greater than 1, another smaller than 1. Clearly, the limit $$\varphi$$ cannot be smaller than 1 (since $$\tfrac{a_{n+1}}{a_n}$$ cannot); thus, this limit (if exists) must be $$\varphi=(1+\sqrt5)/2.$$ This number is the famous "golden ratio" treated already by Euclid about 2300 years ago.

We wonder about the error of the approximate equality $$\tfrac{a_{n+1}}{a_n} \approx \varphi$$ (for large n), that is, $$a_{n+1} \approx \varphi a_n.$$ The absolute error being $$|a_{n+1}-\varphi a_n|,$$ we investigate the difference $$a_{n+1}-\varphi a_n;$$ how does it change with n? Is $$a_{n+2}-\varphi a_{n+1}$$ greater or smaller (in absolute value) than $$a_{n+1}-\varphi a_n?$$

Using the recurrence relation and the property of $$\varphi$$ we get $$a_{n+2}-\varphi a_{n+1} = a_{n+1}+a_n-\varphi a_{n+1} = (1-\varphi)a_{n+1}+a_n = -\frac1\varphi a_{n+1}+a_n = -\frac1\varphi (a_{n+1}-\varphi a_n),$$ which shows that the investigated difference changes the sign and decreases in the absolute value. By induction, $$a_{n+1}-\varphi a_n = \big(-\tfrac1\varphi\big)^{n-1} (a_2-\varphi a_1)$$ for all n. Introducing $$\psi=-\tfrac1\varphi,$$ noting that $$\psi=1-\varphi$$ and recalling that $$a_1=a_2=1$$ we get $$a_{n+1}-\varphi a_n = \psi^n,$$ which shows that the absolute error is decreasing and converges to 0 (since $$-1<\psi<0$$). Existence of the limit follows: $$\tfrac{a_{n+1}}{a_n} = \varphi+\tfrac{a_{n+1}-\varphi a_n}{a_n} \to \varphi.$$

Interestingly, the property $$1+\tfrac1\varphi = \varphi$$ of $$\varphi$$ leads to a similar property $$1+\tfrac1\psi = \psi$$ of $$\psi,$$ as follows: $$1+\tfrac1\psi = 1-\varphi = -\tfrac1\varphi = \psi.$$ Thus, $$\psi$$ is nothing but the other root of the quadratic equation: $$\psi=(1-\sqrt5)/2.$$

The proof of the equality $$a_{n+1}-\varphi a_n = \big(-\tfrac1\varphi\big)^{n-1} (a_2-\varphi a_1)$$ given above does not use any other property of $$\varphi,$$ and therefore it holds for $$\psi$$ as well: $$a_{n+1}-\psi a_n = \big(-\tfrac1\psi\big)^{n-1} (a_2-\psi a_1),$$ that is (as before) $$a_{n+1}-\psi a_n = \varphi^n.$$

Having explicit formulas for $$a_{n+1}-\varphi a_n = \psi^n$$ and $$a_{n+1}-\psi a_n = \varphi^n$$ it is easy to get an explicit formula for $$a_n.$$ We just subtract the first formula from the second and get $$(\varphi-\psi)a_n=\varphi^n-\psi^n,$$ that is, the wonderful formula
 * $$a_n = \frac{(1+\sqrt5)^n-(1-\sqrt5)^n}{2^n \sqrt5}.$$

It follows that $$a_n$$ is the closest integer to $$\varphi^n/\sqrt5.$$

The decimal digits of the number $$\pi$$
(3,1,4,1,5,9,2,6,5,...) By definition, n-th member of this sequence is equal to $$\lfloor 10 \cdot \{ 10^{n-2}\pi \} \rfloor;$$ here $$\lfloor x \rfloor$$ is the integral part of x, and $$\{x\}=x-\lfloor x \rfloor$$ is the fractional part of x. Thus, the first member is $$\lfloor 10 \cdot \{ 10^{-1}\pi \} \rfloor = \lfloor 10 \cdot \{ 0.3141\dots \} \rfloor = \lfloor 10 \cdot 0.3141\dots \rfloor = \lfloor 3.141\dots \rfloor = 3;$$ the second member is $$\lfloor 10 \cdot \{ 10^0\pi \} \rfloor = \lfloor 10 \cdot \{ 3.141\dots \} \rfloor = \lfloor 10 \cdot 0.141\dots \rfloor = \lfloor 1.41\dots \rfloor = 1;$$ the third member is $$\lfloor 10 \cdot \{ 10^1\pi \} \rfloor = \lfloor 10 \cdot \{ 31.41\dots \} \rfloor = \lfloor 10 \cdot 0.41\dots \rfloor = \lfloor 4.1\dots \rfloor = 4;$$ and so on.

In order to calculate $$\pi$$ one may use the formula $$\textstyle \pi = 3 + \frac{4}{2\cdot3\cdot4} - \frac{4}{4\cdot5\cdot6} + \frac{4}{6\cdot7\cdot8} - \frac{4}{8\cdot9\cdot10} + \dots.$$ Trillions (that is, millions of millions) of decimal digits of $$\pi$$ are calculated using better formulas. They look as if they are random! On one hand, this is natural, since we do not know any reason for any regularity in this sequence. On the other hand, this is paradoxical, since in these digits there is not the slightest chance. The equality $$\lfloor 10 \cdot \{ 10^1\pi \} \rfloor = 4$$ is a mathematical theorem, as well as the equality $$\lfloor 10 \cdot \{ 10^{41}\pi \} \rfloor = 9$$, and the same can be said about $$\lfloor 10 \cdot \{ 10^{n-2}\pi \} \rfloor$$ for every n. (See also Numerical calculations and rigorous mathematics.) Each of these (seemingly random) digits, being an eternal mathematical truth, could not be different. Тhis puzzling situation is vividly discussed, see Wicklin, Preuss, mathoverfow etc. "To put our ignorance in perspective, note that it is not even known that all digits appear infinitely often: perhaps Pi = 3.1415926.....01001000100001000001..." (Stan Wagon, Is Pi normal?)