What is the total number of palindromes between 10 and 100000?
Answers
Answer:
A palindromic number is a number (in some base b) that is the same when written forwards or backwards, i.e., of the form a_1a_2...a_2a_1. The first few palindromic numbers are therefore 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 are 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 palindromic numbers less than 10, 10^2, 10^3, ... are 9, 18, 108, 198, 1098, 1998, 10998, ... (OEIS A050250). 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 palindromes (in any base) are composite, with the precise statement being
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.
The sum of the reciprocals of the palindromic numbers converges to a constant approx 3.37018 (OEIS A118031; Rivera), where the value has been computed using all palindromic numbers <=10^8 is 3.370001832....
The first few n for which the pronic number P_n is palindromic are 1, 2, 16, 77, 538, 1621, ... (OEIS A028336), and the first few palindromic numbers which are pronic are 2, 6, 272, 6006, 289982, ... (OEIS A028337). The first few numbers whose squares are palindromic are 1, 2, 3, 11, 22, 26, ... (OEIS A002778), and the first few palindromic squares are 1, 4, 9, 121, 484, 676, ... (OEIS A002779).
There are no palindromic square n-digit numbers for n=2, 4, 8, 10, 14, 18, 20, 24, 30, ... (OEIS A034822).
Numbers that are not the sum of two palindromes (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 palindromes are 1020, 1029, 1031, 1038, 1041, 1047, 1051, 1061, ..