Palindromic Prime Calculator

Primes

is 131 a palindromic prime?Yes - it reads the same backwards and it is prime
digit reversal of n131
primality of nprime
next palindromic prime after n151
How this was calculated
  1. Reverse the digits of 131 to get 131; a palindrome must match its reversal exactly.
  2. Test primality: 131 is prime, with factorization none - it is prime.
  3. Both tests pass, so the number is a palindromic prime.
  4. Every palindromic prime except 11 has an odd number of digits, because an even-digit palindrome is always divisible by 11.

A palindromic prime has to pass two independent tests: its decimal digits must read the same forwards and backwards, and it must be prime. Either condition alone is common - palindromes are everywhere, primes are everywhere - but the overlap is thin and full of structure, including a famous vanishing act: there are no four-digit palindromic primes at all.

This calculator runs both tests, shows the digit reversal, the primality verdict with factorization when composite, and the neighbouring palindromic primes. The contrast to remember: 131 passes both tests, while 111 is a perfect palindrome that fails as a prime because 111 = 3 x 37.

The story continues past 1,000 in a way the four-digit gap makes dramatic. Five-digit palindromic primes exist in relative abundance - 93 of them, starting with 10301 - bringing the total below 100,000 to 113. The pattern of the family is therefore: a handful of small cases, a wall at every even digit length, and a resumption at every odd one. List mode up to any limit shows the wall directly - the output simply jumps from 929 to 10301.

Worked examples

Is 131 a palindromic prime?

(0 - test a single number · 131)

is 131 a palindromic prime?Yes - it reads the same backwards and it is prime
digit reversal of n131
primality of nprime
next palindromic prime after n151

Is 111 a palindromic prime?

(0 - test a single number · 111)

is 111 a palindromic prime?No - it is a palindrome but not prime
digit reversal of n111
primality of ncomposite - 3 x 37
next palindromic prime after n131

Palindromic primes up to 1,000

(1 - list up to a limit · 1000)

palindromic primes up to 1,0002, 3, 5, 7, 11, 101, 131, 151, 181, 191, 313, 353, 373, 383, 727, 757, 787, 797, 919, 929
how many there are20
largest of them929
the only even-digit one11 - every longer even-digit palindrome is divisible by 11

Two tests, one number

The palindrome test is mechanical: reverse the digits and compare. 131 reverses to 131 and passes; 111 also reverses to itself. The primality test is where 111 falls down - it factors as 3 x 37. A palindromic prime needs both, which is why the calculator reports the two verdicts separately: you can see exactly which test a candidate failed.

Single-digit primes 2, 3, 5 and 7 are trivially palindromes, and 11 is the smallest interesting case. From 101 onward the sequence runs 101, 131, 151, 181, 191, 313, 353, 373, 383, 727, 757, 787, 797, 919, 929 - twenty palindromic primes below 1,000 in total.

It is worth pausing on how asymmetric the two tests' difficulties are. The palindrome test costs nothing - a string reversal. The primality test is the entire cost, and it is why the calculator reports a factorization whenever the answer is composite: '111 = 3 x 37' is a complete explanation of the failure, not just a verdict. For palindromes specifically, trial division can stop early surprisingly often, because the divisibility-by-11 barrier and the outer-digit rules pre-filter most candidates before any heavy work.

  • 131: palindrome and prime - a palindromic prime
  • 111: palindrome but 3 x 37 - not a palindromic prime
  • 20 palindromic primes below 1,000, listed in full below
  • Outer digits of a multi-digit palindromic prime must be odd and not 5

Why even-digit palindromes vanish

Every palindrome with an even number of digits is divisible by 11. The reason is the alternating digit sum: in an even-digit palindrome the digits pair up symmetrically, the alternating sum cancels to 0, and 0 is divisible by 11 - the standard divisibility test for 11 then guarantees the whole number is a multiple of 11. So the only even-digit palindromic prime is 11 itself.

The consequence is stark: the count of palindromic primes is 20 below 1,000 and still exactly 20 below 10,000. The entire four-digit range contributes nothing. The sequence only resumes at five digits, and every palindromic prime beyond 11 has an odd number of digits.

The census ladder, for calibration: 5 palindromic primes below 100 (2, 3, 5, 7, 11), 20 below 1,000, and 113 below 100,000 - of which 93 have five digits, the smallest being 10301. Each rung multiplies the range by 100 and the count by roughly 5, the signature of a family thinning like the primes themselves while the palindrome constraint bites at a constant rate.

  • Even-digit palindrome -> alternating digit sum 0 -> divisible by 11
  • 11 is the only even-digit palindromic prime
  • Count below 1,000: 20. Count below 10,000: still 20

The sequence below 1,000

Here is the complete list below 1,000. Notice the three-digit pattern: the first and last digits match and must be 1, 3, 7 or 9 (an even outer digit would make the number even, 5 would make it a multiple of 5), while the middle digit is free - which is why the three-digit entries come in families like 313, 353, 373, 383 around the same outer pair.

The gaps are as informative as the entries. Between 191 and 313 there is nothing, because the 2-2 outer pair is even and excluded, and the 3-3 family starts at 313. Reading the list with the outer-digit rule in mind turns it from a curiosity into a small theorem.

One more pattern hides in the three-digit list: the middle digit is unconstrained by primality except through the total, so families with the same outer pair contribute runs - 101 stands alone for the 1-1 pair's start, while the 7-7 pair contributes 727, 757, 787 and 797, missing only the middle digits that introduce small factors. Reading down a single outer pair's family is a compact lesson in how primality thins a structured set: the symmetry is imposed by hand, and the primes are whatever survives.

DigitsPalindromic primesCount
12, 3, 5, 74
2111
3101, 131, 151, 181, 191, 313, 353, 373, 383, 727, 757, 787, 797, 919, 92915
4none - all divisible by 110

Palindromic primes vs emirps

The sibling emirp page covers the mirror-image concept: an emirp is a prime whose reversal is a different prime, like 13 reversing to 31. Palindromic primes are explicitly excluded from the emirps, because their reversal is themselves. The two families partition the primes-with-prime-reversals into the fixed points (palindromes) and the genuine pairs (emirps).

That makes the palindromic primes the rarer and more rigid family: an emirp pair needs two primes, a palindromic prime needs one prime with a symmetry constraint on its digits - plus the divisibility-by-11 barrier that wipes out every even digit length.

A closing curiosity: the palindromic primes are not distributed evenly among the allowed outer digits. The outer pair must be (1,1), (3,3), (7,7) or (9,9) - the number must start and end with an odd digit that is not 5 - and the four families contribute unequally: among the fifteen three-digit palindromic primes, the 1-1 family contributes five (101, 131, 151, 181, 191), the 3-3 and 7-7 families four each, and the 9-9 family only two (919, 929). The calculator's list mode lets you count the families yourself at any limit and watch the balance shift.

The four-digit gap is a theorem, not a coincidence: every even-digit palindrome is divisible by 11, so the count stays at 20 from 1,000 all the way to 10,000.

Beyond 1,000: the five-digit resumption

The smallest five-digit palindromic prime is 10301, and it earns the place: its outer pair is 1-1, its inner pair 0-0 is forced by the palindrome structure around the central 3, and the number itself is prime. From there the family fills out to 93 five-digit members. The construction rules visible at three digits persist - outer digits from {1, 3, 7, 9}, everything else free - but with two free inner positions the families are far richer.

Counting makes the rhythm plain: 4 one-digit, 1 two-digit, 15 three-digit, 0 four-digit, 93 five-digit - 113 in total below 100,000. Every even length contributes 11 alone; every odd length contributes a growing crowd. Whether infinitely many palindromic primes exist is unknown - the heuristic says yes, comfortably, but no proof exists, which is a striking gap for such an elementary definition.

For a hands-on feel, list mode up to 1,000 and then up to 100,000 brackets the phenomenon: the first list has 20 entries and stops at 929; the second has 113 and its first new entry is 10301, with nothing at all in between.

  • Five-digit palindromic primes: 93, the smallest is 10301
  • Total below 100,000: 113
  • Digit-length counts: 4, 1, 15, 0, 93 - zero at every even length beyond 2

Palindromic primes in other bases

Everything on this page is base 10, but the definition travels. In binary, a palindromic prime must have an odd number of bits (an even-length binary palindrome is divisible by 3, the same style of barrier as the base-10 divisibility by 11), and the binary family starts 5 (101), 7 (111), 17 (10001), 31 (11111), 73 (1001001). Several binary palindromic primes are Mersenne primes in disguise - a binary palindrome of all ones is a Mersenne number, and 31 is the famous example.

The base-dependence cuts both ways: 131 is a palindromic prime in base 10 but unremarkable in binary, while 17 is ordinary in decimal and a palindrome in binary. No base is privileged by the mathematics - base 10 is privileged by the reader, which is why this calculator, like most references, works in decimal and says so.

The decimal family's open problem is worth repeating in this wider frame: infinitely many palindromic primes are expected in base 10, and in every base, yet in no base has infinitude been proved. The calculator's lists are finite windows on a family that is conjectured, but not known, to be endless.

  • Binary palindromic primes start 5, 7, 17, 31, 73
  • Even-length binary palindromes are divisible by 3 - the same barrier pattern as base 10's 11
  • Infinitude is conjectured in every base and proved in none

FAQs

What is a palindromic prime?

A prime that reads the same forwards and backwards, like 131. It must pass both tests - palindromic form and primality - which this calculator reports separately.

Is 111 a palindromic prime?

No. 111 is a palindrome, but 111 = 3 x 37, so it fails the primality test. A palindromic prime needs both properties at once.

How many palindromic primes are there below 1,000?

Exactly 20: 2, 3, 5, 7, 11, 101, 131, 151, 181, 191, 313, 353, 373, 383, 727, 757, 787, 797, 919 and 929.

Why are there no four-digit palindromic primes?

Every palindrome with an even number of digits is divisible by 11, so the only even-digit palindromic prime is 11 itself. The count is 20 below 1,000 and remains 20 below 10,000.

What is the smallest palindromic prime?

2. The single-digit primes 2, 3, 5 and 7 are all trivially palindromes, followed by 11 and then 101.

What is the difference between a palindromic prime and an emirp?

An emirp is a prime whose reversal is a different prime (13 -> 31). A palindromic prime's reversal is itself, and emirps by definition exclude palindromes - the two families are complementary.

Sources

Related calculators

Chen Prime Calculator
Check whether a prime is a Chen prime - p where p + 2 is prime or semiprime - or list Chen primes up to a limit.
Circular Prime Calculator
Test whether a number is a circular prime - prime under every cyclic rotation of its digits - listing all rotations and the next circular prime.
Cousin Prime Calculator
Count cousin prime pairs - primes differing by 4 - up to a limit by sieve, with the largest pair in range and the twin-prime count at the same limit for comparison.