# 31 (number)

31 (thirty-one) is the natural number following 30 and preceding 32. It is a prime number.

## Mathematics

31 is the 11th prime number. It is a superprime and a self prime (after 3, 5, and 7), as no integer added up to its base 10 digits results in 31. It is the third Mersenne prime of the form 2$^n$ − 1, and the eighth Mersenne prime exponent, in-turn yielding the maximum positive value for a 32-bit signed binary integer in computing: 2,147,483,647. After 3, it is the second Mersenne prime not to be a double Mersenne prime, while the 31st prime number (127) is the second double Mersenne prime, following 7. On the other hand, the thirty-first triangular number is the perfect number 496, of the form 2$^{(5−1)}$(2$^5$ − 1) by the Euclid-Euler theorem. 31 is also a primorial prime like its twin prime (29), as well as both a lucky prime and a happy number like its dual permutable prime in decimal (13).
31 is the number of regular polygons with an odd number of sides that are known to be constructible with compass and straightedge, from combinations of known Fermat primes of the form 2$^{2n}$ + 1 (they are 3, 5, 17, 257 and 65537).
Only two numbers have a sum-of-divisors equal to 31: 16 (1 + 2 + 4 + 8 + 16) and 25 (1 + 5 + 25), respectively the square of 4, and of 5. In total, only thirty-one integers are not the sum of distinct squares (31 is the sixteenth such number, where the largest is 124).
31 is the 11th and final consecutive supersingular prime. After 31, the only supersingular primes are 41, 47, 59, and 71.
31 is the first prime centered pentagonal number, the fifth centered triangular number, and the first non-trivial centered decagonal number.
For the Steiner tree problem, 31 is the number of possible Steiner topologies for Steiner trees with 4 terminals.
At 31, the Mertens function sets a new low of −4, a value which is not subceded until 110.
31 is a repdigit in base 2 (11111) and in base 5 (111).
The cube root of 31 is the value of π correct to four significant figures:
    ${\sqrt[{3}]{3}}1=3.141\;{\color {red}38065\;\ldots }$
The thirty-first digit in the fractional part of the decimal expansion for pi in base-10 is the last consecutive non-zero digit represented, starting from the beginning of the expansion (i.e, the thirty-second single-digit string is the first $0$); the partial sum of digits up to this point is $155=31\times 5.$ 31 is also the prime partial sum of digits of the decimal expansion of pi after the eighth digit.
The first five Euclid numbers of the form p$_1$ × p$_2$ × p$_3$ × ... × p$_n$ + 1 (with p$_n$ the nth prime) are prime:
* 3 = 2 + 1
* 7 = 2 × 3 + 1
* 31 = 2 × 3 × 5 + 1
* 211 = 2 × 3 × 5 × 7 + 1 and
* 2311 = 2 × 3 × 5 × 7 × 11 + 1
The following term, 30031 = 59 × 509 = 2 × 3 × 5 × 7 × 11 × 13 + 1, is composite. The next prime number of this form has a largest prime p of 31: 2 × 3 × 5 × 7 × 11 × 13 × ... × 31 + 1 ≈ 8.2 × 10$^{33}$.
While 13 and 31 in base-ten are the proper first duo of two-digit permutable primes and emirps with distinct digits in base ten, 11 is the only two-digit permutable prime that is its own permutable prime. Meanwhile 13$_{10}$ in ternary is 111$_3$ and 31$_{10}$ in quinary is 111$_5$, with 13$_{10}$ in quaternary represented as 31$_4$ and 31$_{10}$ as 133$_4$ (their mirror permutations 331$_4$ and 13$_4$, equivalent to 61 and 7 in decimal, respectively, are also prime). (11, 13) form the third twin prime pair between the fifth and sixth prime numbers whose indices add to 11, itself the prime index of 31. Where 31 is the prime index of the fourth Mersenne prime, the first three Mersenne primes (3, 7, 31) sum to the thirteenth prime number, 41. 13 and 31 are also the smallest values to reach record lows in the Mertens function, of −3 and −4 respectively.
The numbers 31, 331, 3331, 33331, 333331, 3333331, and 33333331 are all prime. For a time it was thought that every number of the form 3$_w$1 would be prime. However, the next nine numbers of the sequence are composite; their factorisations are:
* 333333331 = 17 × 19607843
* 3333333331 = 673 × 4952947
* 33333333331 = 307 × 108577633
* 333333333331 = 19 × 83 × 211371803
* 3333333333331 = 523 × 3049 × 2090353
* 33333333333331 = 607 × 1511 × 1997 × 18199
* 333333333333331 = 181 × 1841620626151
* 3333333333333331 = 199 × 16750418760469 and
* 33333333333333331 = 31 × 1499 × 717324094199.
The next term (3$_{17}$1) is prime, and the recurrence of the factor 31 in the last composite member of the sequence above can be used to prove that no sequence of the type R$_w$E or ER$_w$ can consist only of primes, because every prime in the sequence will periodically divide further numbers.
31 is the maximum number of areas inside a circle created from the edges and diagonals of an inscribed six-sided polygon, per Moser's circle problem. It is also equal to the sum of the maximum number of areas generated by the first five n-sided polygons: 1, 2, 4, 8, 16, and as such, 31 is the first member that diverges from twice the value of its previous member in the sequence, by 1.
Icosahedral symmetry contains a total of thirty-one axes of symmetry; six five-fold, ten three-fold, and fifteen two-fold.

## In other fields

31 equal temperament is a popular microtonal tuning for musical instruments because it provides a good approximation of harmonic intervals.
Thirty-one is also a slang term for masturbation in Turkish.