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.[13] In total, only thirty-one integers are not the sum of distinct squares (31 is the sixteenth such number, where the largest is 124).[14]
31 is the 11th and final consecutive supersingular prime.[15] After 31, the only supersingular primes are 41, 47, 59, and 71.
For the Steiner tree problem, 31 is the number of possible Steiner topologies for Steiner trees with 4 terminals.[19]
At 31, the Mertens function sets a new low of −4, a value which is not subceded until 110.[20]
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:
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 );[21] the partial sum of digits up to this point is [22] 31 is also the prime partial sum of digits of the decimal expansion of pi after the eighth digit.[23][a]
The first five Euclid numbers of the form p1 × p2 × p3 × ... × pn + 1 (with pn the nth prime) are prime:[25]
The following term, 30031 = 59 × 509 = 2 × 3 × 5 × 7 × 11 × 13 + 1, is composite.[b] The next prime number of this form has a largest prime p of 31: 2 × 3 × 5 × 7 × 11 × 13 × ... × 31 + 1 ≈ 8.2 × 1033.[26]
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.[10][27] Meanwhile 1310 in ternary is 1113 and 3110 in quinary is 1115, with 1310 in quaternary represented as 314 and 3110 as 1334 (their mirror permutations 3314 and 134, equivalent to 61 and 7 in decimal, respectively, are also prime). (11, 13) form the third twin prime pair[6] between the fifth and sixth prime numbers whose indices add to 11, itself the prime index of 31.[28] Where 31 is the prime index of the fourth Mersenne prime,[2] the first three Mersenne primes (3, 7, 31) sum to the thirteenth prime number, 41.[28][c] 13 and 31 are also the smallest values to reach record lows in the Mertens function, of −3 and −4 respectively.[30]
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 3w1 would be prime. However, the next nine numbers of the sequence are composite; their factorisations are:
The next term (3171) 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 RwE or ERw can consist only of primes, because every prime in the sequence will periodically divide further numbers.[citation needed]
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.[31] 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.
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.[33]
Notes
^On the other hand, "31" as a string represents the first decimal expansion of pi truncated to numbers such that the partial sums of the decimal digits are square numbers.[24]
^On the other hand, 13 is a largest p of a primorial prime of the form pn# − 1 = 30029 (sequence A057704 in the OEIS).
^Also, the sum between the sum and product of the first two Mersenne primes is (3 + 7) + (3 × 7) = 10 + 21 = 31, where its difference (11) is the prime index of 31.[28] Thirty-one is also in equivalence with 14 + 17, which are respectively the seventh composite[29] and prime numbers,[28] whose difference in turn is three.