A050686 Number of palindromes of length n and containing the digit 1 (or any other fixed nonzero digit).
1, 1, 18, 18, 252, 252, 3168, 3168, 37512, 37512, 427608, 427608, 4748472, 4748472, 51736248, 51736248, 555626232, 555626232, 5900636088, 5900636088, 62105724792, 62105724792, 648951523128, 648951523128, 6740563708152
Offset: 1
Examples
For length 3 we find 18 numbers: 101, 111, 121, 131, 141, 151, 161, 171, 181, 191, 212, 313, 414, 515, 616, 717, 818, 919.
Formula
Empirical g.f.: -x*(x-1)*(x+1)^2 / ((3*x-1)*(3*x+1)*(10*x^2-1)). - Colin Barker, Feb 15 2013
From Sela Fried, Dec 10 2024: (Start)
The conjectured g.f is correct.
a(n) = 9*10^(n/2 - 1) - 8*9^(n/2 - 1) if n is even
a(n) = 9*10^((n - 1)/2) - 8*9^((n - 1)/2) if n is odd. (End)
Extensions
More terms from Michael Lugo (mlugo(AT)thelabelguy.com), Dec 22 1999