TOPICS
Search

Palindromic Number


PalindromicNumbers

A palindromic number is a nonnegative integer whose usual digits in a fixed base b>=2 read the same forwards and backwards, where b is an integer and leading zeros are excluded. Unless otherwise specified, base 10 is used. The first few decimal palindromic numbers are 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 11, 22, 33, 44, 55, 66, 77, 88, 99, 101, 111, 121, ... (OEIS A002113). The number of palindromic numbers less than a given number is illustrated in the plot above.

A number n can be tested to see if it is palindromic in the Wolfram Language using PalindromeQ[n].

The numbers of positive palindromic numbers less than 10, 10^2, 10^3, ... are 9, 18, 108, 198, 1098, 1998, 10998, ... (OEIS A050250). For a positive integer n, this sequence is given by the closed-form formula

 a(n)={2(10^(n/2)-1)   for n even; 11·10^((n-1)/2)-2   for n odd.
(1)

Banks et al. (2004) proved that almost all palindromic numbers in any fixed base b>=2 are composite. More precisely, as x->infty, they proved the big-O notation estimate

 P(x)=O((N(x)lnlnlnx)/(lnlnx)),
(2)

where P(x) is the number of palindromic primes <=x and N(x) is the number of palindromic numbers <=x in base b. The implied constant may depend on b.

Cilleruelo et al. (2018) proved that every positive integer is a sum of at most three palindromic numbers in any integer base g>=5. Their algorithm for explicitly producing these palindromic numbers is implemented interactively by Baxter and Lawson-Perfect. Pegg (2026) gives a Wolfram Language implementation.

Rajasekaran et al. (2018) proved that every nonnegative integer is a sum of at most four palindromic numbers in base 2, and of at most three in base 3 or 4. The bound of four in base 2 is optimal, since 176 cannot be expressed as a sum of three or fewer such numbers.

For a fixed integer base g>=2, let A_g(X) count the positive integers at most X that are a sum of two palindromic numbers. Zakharov (2024) proved that, for some constant c_g>0,

 A_g(X)=O_g(X/((lnX)^(c_g))).
(3)

Thus these integers have natural density zero. Zakharov counts positive palindromes, but allowing 0 adds only O_g(sqrt(X)) possible sums and leaves this conclusion unchanged. Cilleruelo et al. (2018) give the lower bound A_g(X)>=Xexp(-C_gsqrt(lnX)) for some constant C_g>0 and all sufficiently large X. The gap between these bounds remains open.

The sum of the reciprocals of the positive palindromic numbers converges to a constant 3.3702832594...(OEIS A118031; Rivera). The partial sum over positive palindromic numbers <=10^8 is 3.370001832....

The first few positive integers n for which the pronic number P_n is palindromic are 1, 2, 16, 77, 538, 1621, ... (OEIS A028336), and the first few positive palindromic numbers which are pronic are 2, 6, 272, 6006, 289982, ... (OEIS A028337). The first few positive integers whose squares are palindromic are 1, 2, 3, 11, 22, 26, ... (OEIS A002778), and the first few positive palindromic squares are 1, 4, 9, 121, 484, 676, ... (OEIS A002779).

There are no palindromic square numbers with n digits for n=2, 4, 8, 10, 14, 18, 20, 24, 30, ... (OEIS A034822).

Numbers that are not the sum of two palindromic numbers (where 0 is itself considered a palindrome) are 21, 32, 43, 54, 65, 76, 87, 98, 201, 1031, ... (OEIS A035137). Numbers that are not the difference of two palindromic numbers are 1020, 1029, 1031, 1038, 1041, 1047, 1051, 1061, ... (OEIS A104444).

The digits of an integer can be reversed in the Wolfram Language using IntegerReverse.


See also

Belphegor Number, Demlo Number, Palindromic Number Conjecture, Palindromic Prime, Reversal, Tetradic Number

Explore with Wolfram|Alpha

References

Banks, W. D.; Hart, D. N.; and Sakata, M. "Almost All Palindromes Are Composite." Math. Res. Lett. 11, 853-868, 2004. https://doi.org/10.4310/MRL.2004.v11.n6.a10.Baxter, L. "Sum of 3 Palindromes." https://www.rnta.eu/cgi-bin/three_palindromes/pal3.py.Beiler, A. H. Recreations in the Theory of Numbers: The Queen of Mathematics Entertains. New York: Dover, 1964.Cilleruelo, J.; Luca, F.; and Baxter, L. "Every Positive Integer Is a Sum of Three Palindromes." Math. Comput. 87, 3023-3055, 2018. https://doi.org/10.1090/mcom/3221.De Geest, P. "Palindromic Numbers and Other Recreational Topics." https://www.worldofnumbers.com/index.shtml.De Geest, P. "Palindromic Products of Two Consecutive Integers." https://www.worldofnumbers.com/consec.htm.De Geest, P. "Palindromic Squares." https://www.worldofnumbers.com/square.htm.Dr. Pete. "The Math Forum. Ask Dr. Math: Questions & Answers from Our Archives. Palindromic Numbers." https://web.archive.org/web/20020409134934/http://mathforum.org/dr.math/problems/akyildiz1.4.98.html.Dr. Rob. "The Math Forum. Ask Dr. Math: Questions & Answers from Our Archives. Palindromic Numbers." https://web.archive.org/web/20020409135101/http://mathforum.org/dr.math/problems/stang4.8.14.97.html.Heinz, H. "Palindromes." https://web.archive.org/web/20241106143715/http://www.magic-squares.net/palindromes.htm.Lawson-Perfect, C. "The Incredible Palindromic Hat-Trick." May 4, 2018. https://aperiodical.com/2018/05/the-incredible-palindromic-hat-trick/.MathPages. "On General Palindromic Numbers." https://www.mathpages.com/home/kmath359.htm.Numberphile. "Every Number Is the Sum of Three Palindromes." Sep. 17, 2018. https://www.youtube.com/watch?v=OKhacWQ2fCs.Pappas, T. "Numerical Palindromes." The Joy of Mathematics. San Carlos, CA: Wide World Publ./Tetra, p. 146, 1989. Pegg, E. Jr. "PalindromicTripleSum." 30 Jan. 2026. https://resources.wolframcloud.com/FunctionRepository/resources/PalindromicTripleSum/.Rajasekaran, A.; Shallit, J.; and Smith, T. "Sums of Palindromes: An Approach via Automata." In Proc. 35th Symposium on Theoretical Aspects of Computer Science (STACS 2018) (Ed. R. Niedermeier and B. Vallée). Dagstuhl, Germany: Schloss Dagstuhl-Leibniz-Zentrum für Informatik, pp. 54:1-54:12, 2018. https://doi.org/10.4230/LIPIcs.STACS.2018.54.Rivera, C. "Problems & Puzzles: Puzzle 056-The Honaker's Constant." https://www.primepuzzles.net/puzzles/puzz_056.htm.Sloane, N. J. A. Sequences A002113/M0484, A002385/M0670, A002778/M0907, A002779/M3371, A028336, A028337, A034822, A035137, A050250, A104444, and A118031 in "The On-Line Encyclopedia of Integer Sequences."Zakharov, D. "Most Integers Are Not a Sum of Two Palindromes." Math. Proc. Cambridge Philos. Soc. 177, 363-366, 2024. https://doi.org/10.1017/S0305004124000276.

Referenced on Wolfram|Alpha

Palindromic Number

Cite this as:

Weisstein, Eric W. "Palindromic Number." From MathWorld--A Wolfram Resource. https://mathworld.wolfram.com/PalindromicNumber.html

Subject classifications