31
Seven months have 31 days, and 31 October is Halloween. 31 is prime, and the atomic number of gallium — a metal that melts in your hand.
- Odd
- Prime
Where 31 fits
Why 31 is special
31 forms a twin-prime pair with 29, and separately is the longest a calendar month ever gets.
Same number, different meanings
How 31 is understood across different contexts — never implying one meaning because of another.
- Mathematics
31 forms a twin-prime pair with 29, and separately is the longest a calendar month ever gets.
- History
Seven months have 31 days, and the distribution was fixed by the Julian reform of 46 BCE. A frequently repeated story says August was lengthened from 30 to 31 so that Augustus would not be outdone by Julius Caesar's July — but that account first appears more than a thousand years later, in the thirteenth-century writer Sacrobosco, and modern scholarship rejects it. The lengths were set before Augustus was born.
- Everyday life
January, March, May, July, August, October and December each have 31 days — seven of the twelve calendar months.
- Culture
31 October is Halloween, observed in Ireland, Britain, North America and, increasingly, elsewhere; customs vary considerably. The eve of All Saints' Day, with roots in the Gaelic festival of Samhain marking the end of the harvest season. Many of the modern customs — costumes, trick-or-treating, carved lanterns — took their present form in North America in the nineteenth and twentieth centuries.
- Science
31 is the atomic number of gallium, a metal with an unusually low melting point — just above room temperature.
Not just a mathematical number
31is also used in ways where ordinary arithmetic doesn't apply — each listed below with what genuinely does and doesn't follow from it.
- Mathematical number
A genuine quantity — its mathematical properties (prime, square, factors, and so on) are real facts about it.
A genuine quantity that ordinary arithmetic applies to — it can be prime, even, a perfect square, added to another number meaningfully, and so on.
- Measurement
Also used as a measurement — Calendar years.
A quantity expressed against a defined unit or standard (24 hours in a day, 60 seconds in a minute) — arithmetic is meaningful, but the specific value is a fixed convention of the measuring system, not a discovered mathematical property.
Factors & digit properties
- Divisors (2)
- 1, 31
- Prime factorisation
- 31
- Digit sum
- 4
- Digital root
- 4
Representations
- Decimal
- 31
- Scientific notation
- 3.100 × 10^1
Roman numerals
X X X I
Binary
1 1 1 1 1
1 × 16 + 1 × 8 + 1 × 4 + 1 × 2 + 1 × 1 = 31
Octal
3 7
3 × 8 + 7 × 1 = 31
Hexadecimal
1 f
1 × 16 + f × 1 = 31
Read as powers of two: 16 + 8 + 4 + 2 + 1 = 31.
In historical numeral systems
Egyptian
3 hobbles, 1 stroke
3 × 10 + 1 × 1 = 31. The signs are simply repeated and added; where they sit on the line is a matter of layout, not value.
Babylonian
3 corner wedges + 1 vertical wedge
31 fits in a single sexagesimal place: 3 corner wedges + 1 vertical wedge.
Greek (Ionic)
lambda, then alpha, marked as a numeral
lambda-alpha + keraia
lambda + alpha written in descending order and added — the letters carry their values wherever they stand, so this is addition, not place value.
Hebrew numerals
lamed, then alef
lamed-alef
lamed (30) + alef (1) = 31, written in descending order.
Chinese numerals
sān shí yī
sān shí yī
三 before 十 multiplies it: 3 tens. 一 after it adds 1. The written form mirrors the arithmetic — "sān shí yī". The financial (anti-fraud) form is 參拾壹.
Maya
1 dot (upper, twenties place) over 2 bars + 1 dot (lower, units place)
1 × 20 + 11 = 31. Places stack vertically with the smallest at the bottom, so the upper group is worth twenty times the lower.
Systems that simply cannot reach this value are left out. Where a script needs a font most readers do not have, the reading is given instead of the glyphs — see number systems for each system in full.
Other mathematical patterns
Related numbers & connections
31 is a factor of 62 (31 × 2 = 62).
View 62 →29 and 31 are twin primes — two primes exactly two apart.
View 29 →January, March, May, July, August, October and December each have 31 days — seven of the twelve months, and the longest month length the calendar uses.
History
Seven months have 31 days, and the distribution was fixed by the Julian reform of 46 BCE. A frequently repeated story says August was lengthened from 30 to 31 so that Augustus would not be outdone by Julius Caesar's July — but that account first appears more than a thousand years later, in the thirteenth-century writer Sacrobosco, and modern scholarship rejects it. The lengths were set before Augustus was born.
DocumentedHistoryPeriod: 46 BCE; the story from the 13th century CE
Everyday life
January, March, May, July, August, October and December each have 31 days — seven of the twelve calendar months.
DocumentedEveryday life
Culture
31 October is Halloween, observed in Ireland, Britain, North America and, increasingly, elsewhere; customs vary considerably. The eve of All Saints' Day, with roots in the Gaelic festival of Samhain marking the end of the harvest season. Many of the modern customs — costumes, trick-or-treating, carved lanterns — took their present form in North America in the nineteenth and twentieth centuries.
DocumentedCultureGeography: Ireland, Britain, North America and, increasingly, elsewhere; customs vary considerably
Science
31 is the atomic number of gallium, a metal with an unusually low melting point — just above room temperature.
DocumentedScience
Common questions
Which months have 31 days?
January, March, May, July, August, October and December — seven of the twelve. The irregular pattern is inherited from the Roman calendar rather than designed; July and August are both 31 days because they were named after Julius and Augustus Caesar.
Is 31 a prime number?
Yes, 31 is prime — it has exactly two positive divisors: 1 and itself.
What are the factors of 31?
The factors of 31 are 1, 31.
What is 31 in Roman numerals?
31 in Roman numerals is XXXI.
About this page's data
Mathematical facts:computed directly from the number's value — nothing to source or verify externally.
Contextual records: 4 reviewer-confirmed records, sourced and reviewed before publication.
Last reviewed: 15 July 2026