A139705 Number of entries in A139704 ("nearly palindromic numbers") with n digits.
0, 81, 153, 2268, 3150, 38718
Offset: 1
This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.
a(1)=1 for instance 8-7. a(2)=11 for instance 22-11. a(3)=10 for instance 111-101. a(n)=11 for n >= 4, for instance 2002-1991, resp. generalization to n digits (cf. comment).
A217789(n)=11-(n==3)-(n==1)*10 \\ [M. F. Hasler, Mar 25 2013]
LinearRecurrence[{0,6},{5,5},30] (* Harvey P. Dale, Dec 09 2023 *)
6*7^Floor[Range[0,40]/2] (* Harvey P. Dale, Mar 23 2012 *)
LinearRecurrence[{0,8},{7,7},30] (* Harvey P. Dale, Apr 09 2021 *)
The sum of all nine two-digit palindromes is 11 + 22 + 33 + 44 + 55 + 66 + 77 + 88 + 99 = 495, and so a(2) = 495. The sum of all three-digit palindromes is (101 + 999) + (111 + 989) + (121 + 979) + ... (545 + 565) + 555 = 49500, and so a(3) = 49500.
palSum[n_] := 99/2*10^(n - 1) * 10^Floor[(n - 1)/2]; palSum[1] = 45; Array[ palSum, 16] (* Robert G. Wilson v, Nov 21 2017 *)
a(n) = if (n==1, 45, 9*10^floor((n-1)/2)*11*10^(n-1)/2); \\ Michel Marcus, Dec 26 2017
Comments