A050684 Number of nonzero palindromes < 10^n and containing at least one digit '1'.
1, 2, 20, 38, 290, 542, 3710, 6878, 44390, 81902, 509510, 937118, 5685590, 10434062, 62170310, 113906558, 669532790, 1225159022, 7125795110, 13026431198, 75132155990, 137237880782, 786189403910, 1435140927038
Offset: 1
Examples
Up to 10^2 we find two numbers 1 and 11.
Links
- G. C. Greubel, Table of n, a(n) for n = 1..1000
- Index entries for linear recurrences with constant coefficients, signature (0,19,0,-90).
Programs
-
Mathematica
Table[If[EvenQ[n], 2*(10^(n/2) - 9^(n/2)) , 2*(10^((n - 1)/2) - 9^((n - 1)/2)) + 9*10^((n - 1)/2) - 8*9^((n - 1)/2)], {n, 25}] (* or *) LinearRecurrence[{0, 19, 0, -90},{1, 2, 20, 38},25] (* G. C. Greubel, Oct 27 2016 *)
Formula
a(2n) = 2*(10^n - 9^n); a(2n + 1) = 2*(10^n - 9^n) + 9*10^n - 8*9^n. - David Wasserman, Feb 14 2002
Extensions
More terms from David Wasserman, Feb 14 2002