Contents:
A palindrome, from ancient Greek πάλιν, “back, again,” and δρόμος, “running, movement,” is a number, letter sequence, word or text that reads the same in both directions. The Russian term perevyortysh also means something turned around.
Examples in Russian are madam (“madam”), shalash (“hut”), and A roza upala na lapu Azora (“A rose fell on Azor’s paw”), often attributed to Afanasy Fet. Their palindromic form is found in the original Cyrillic spelling.
In mathematics, palindromes occur in connection with certain number-theory problems. The concept is broader, however, appearing in different sciences and cultures.
Some facts and stories about palindromes
- There are infinitely many palindromic numbers, for example 1, 11, 101, 1001, 10001, … .
- Their number of digits may be even or odd: 123321, 12321.
- As numbers grow, palindromes become increasingly rare among the natural numbers. Every one-digit number is a palindrome by definition, but between 10 and 1000 there are 99 out of 991, or ≈ 9.99%, slightly less than 10%.
- Palindromic primes include 2, 3, 5, 7, 11, 101, 131, 151, 181, 191, 313, 727, 10301, … .
A useful observation: every decimal palindrome with an even number of digits is divisible by 11. Therefore, apart from 11 itself, all palindromic primes have odd length. This follows from the divisibility test for 11, using the alternating sum of digits. - Records for palindromic primes are continually updated. For example, in August 2024, as noted in the Palindrome section of PrimePages, a number of the form 10²⁷¹⁸²⁸¹ − 5⋅10¹⁶³¹¹³⁸ − 5⋅10¹⁰⁸⁷¹⁴² − 1 was proved prime. It has 2 718 281 digits.
- Special types of palindromes include repunits, consisting entirely of ones, such as 111, and repdigits, consisting of repeated identical digits, such as 222.
- Popular mathematics books, including Martin Gardner’s Aha!, mention a “palindrome conjecture” that uses reversal: repeatedly add a number to its digit reversal until a palindrome appears.
Example: 96 + 69 = 165, 165 + 561 = 726, 726 + 627 = 1353, 1353 + 3531 = 4884, a palindrome. - The “196 problem”: the number 196 and many others, candidates for Lychrel numbers, fail to produce a palindrome even after very many reverse-and-add operations. In base ten, it has not yet been proved whether any number never becomes a palindrome by this process.
- Testing for a palindrome is a classic computer-science exercise: compare the first digit with the last, the second with the second from last, and so on. If every pair matches, the number is a palindrome.
- Some squares are palindromes too: 11² = 121, 111² = 12321.
- Is there an equation generating all palindromic numbers? Yes: the simplest “palindrome generator” appends a number’s digit reversal to its right. Each ordinary number gives two palindromes: (n) & (reverse n), and (n without its last digit) & (reverse n), where & denotes digit concatenation and reverse n means the digits of n written in reverse order.
For example: 123 → 123 & 321 = 123321, and 12 & 321 = 12321.
The second version has odd length. Thus ordinary numbers of length n produce palindromes of length 2n or 2n − 1.
A school problem about palindromes
A problem of this kind appears in Russia’s Unified State Examination.
Call a natural number a palindrome if its decimal digits are arranged symmetrically.
a) Give an example of a palindromic number divisible by 45.
b) How many five-digit palindromic numbers are divisible by 45?
c) Find the 10th smallest palindromic number divisible by 45.
Such numbers are not studied extensively in the school curriculum, which is why the definition is included in the problem itself.
Working through the examination problem
Notice that 45 = 5⋅9. The number must therefore be divisible by both 5 and 9.
a) Example: 585. It is a palindrome; its digit sum, 5 + 8 + 5 = 18, is divisible by 9, and its last digit is 5, so it is divisible by 5. Therefore 585 is divisible by 45.
b) Let us find how many five-digit palindromes are divisible by 45.
Every five-digit palindrome has the form A B C B A, where A is the first and last digit and A ≠ 0.
For divisibility by 5, the last digit must be 0 or 5. If it is 0, however, the first digit is also 0, and the number cannot have five digits. Therefore A = 5.
Our palindromes thus have the form 5 B C B 5.
Now use the divisibility test for 9: a number is divisible by 9 if and only if its digit sum is divisible by 9.
The digit sum is 5 + B + C + B + 5 = 10 + 2B + C. We need 10 + 2B + C to be divisible by 9.
Next, it is easiest to try the values of B systematically, using the school method of “substitute and check.” Let B = 0, 1, 2, …, 9. Then 10 + 2B is known, and we choose C, a digit from 0 to 9, to make the sum a multiple of 9.
Calculate in order, remembering the nearby multiples of 9: 9, 18, 27, 36.
- B = 0: 10 + 0 = 10 → 8 short of 18 → C = 8
- B = 1: 10 + 2 = 12 → 6 short of 18 → C = 6
- B = 2: 10 + 4 = 14 → 4 short of 18 → C = 4
- B = 3: 10 + 6 = 16 → 2 short of 18 → C = 2
- B = 4: 10 + 8 = 18 → already a multiple of 9 → C = 0 or C = 9, both work
- B = 5: 10 + 10 = 20 → 7 short of 27 → C = 7
- B = 6: 10 + 12 = 22 → 5 short of 27 → C = 5
- B = 7: 10 + 14 = 24 → 3 short of 27 → C = 3
- B = 8: 10 + 16 = 26 → 1 short of 27 → C = 1
- B = 9: 10 + 18 = 28 → 8 short of 36 → C = 8
Usually there is exactly one C for each B; for B = 4 there are two, C = 0 and C = 9. The total is therefore 9⋅1 + 1⋅2 = 11 palindromes.
Answer: 11.
c) Find the 10th smallest palindromic number divisible by 45.
First note that palindromes divisible by 45 need not have five digits. The two smallest examples are 585 and 5445.
We already know that the qualifying five-digit palindromes have the form 5 B C B 5, with the values of C found for each B. The 10th smallest palindrome is therefore the eighth smallest among the five-digit ones.
List the five-digit numbers in increasing order, taking B from 0 to 9 and, for B = 4, taking C = 0 before C = 9:
- B = 0: 50805
- B = 1: 51615
- B = 2: 52425
- B = 3: 53235
- B = 4, C = 0: 54045
- B = 4, C = 9: 54945
- B = 5: 55755
- B = 6: 56565
- B = 7: 57375
- B = 8: 58185
- B = 9: 59895
The 10th smallest is therefore 56565.
This is easy to check: its digit sum, 5 + 6 + 5 + 6 + 5 = 27, is divisible by 9, and its last digit is 5, so it is divisible by 45.
Afterword
Palindromes in art are more than words such as Russian shalash or A roza upala na lapu Azora. They are a special technique: constructing a form that holds together when read or perceived in either direction, like a mirror that not only reflects a pattern but continues it.
In literature, palindromic phrases and lines work as both riddles and incantations. The reader catches the moment when meaning seems to reverse itself, and the text begins to sound different. In music, a symmetrical structure produces a similar effect: a theme unfolds and then returns in reverse order, as though time were being rewound. In architecture and ornament, this appears in rhythms and repetitions that can be followed both ways along an axis.
In visual art, palindromic form is especially clear: the eye reads symmetry instantly. In M. C. Escher’s work it becomes an actual narrative. In the woodcut Day and Night (1938), the same structure unfolds in two directions at once: white birds become black, fields become sky, day becomes night. It is almost a mathematical palindrome, made of images rather than digits. Step by step the drawing turns around yet remains itself, which makes it seem more alive.
