A palindromic prime (sometimes called a palprime) is a prime number that is also a palindromic number. Palindromicity depends on the base of the numbering system and its writing conventions, while primality is independent of such concerns. The first few decimal palindromic primes are:
- 2, 3, 5, 7, 11, 101, 131, 151, 181, 191, 313, 353, 373, 383, 727, 757, 787, 797, 919, 929, … (sequence A002385 in OEIS)
Except for 11, all palindromic primes have an odd number of digits, because the divisibility test for 11 tells us that every palindromic number with an even number of digits is a multiple of 11. It is not known if there are infinitely many palindromic primes in base 10. The largest known as of January 2013[update] is 10314727 - 8×10157363 - 1, found by Harvey Dubner.
In binary, the palindromic primes include the Mersenne primes and the Fermat primes. All binary palindromic primes except binary 11 (decimal 3) have an odd number of digits; those palindromes with an even number of digits are divisible by 3. The sequence of binary palindromic primes begins (in binary):
- 11, 101, 111, 10001, 11111, 1001001, 1101011, 1111111, 100000001, 100111001, 110111011, … (sequence A117697 in OEIS)
Ribenboim defines a triply palindromic prime as a prime p for which: p is a palindromic prime with q digits, where q is a palindromic prime with r digits, where r is also a palindromic prime. For example, p = 1011310 + 4661664×105,652 + 1, which has q = 11311 digits, and 11311 has r = 5 digits. The first (base-10) triply palindromic prime is the 11-digit 10000500001. It's possible that a triply palindromic prime in base 10 may also be palindromic in another base, such as base 2, but it would be highly remarkable if it were also a triply palindromic prime in that base as well.