login
A117868
Number of palindromes (in base 9) below 9^n.
1
8, 16, 88, 160, 808, 1456, 7288, 13120, 65608, 118096, 590488, 1062880, 5314408, 9565936, 47829688, 86093440, 430467208, 774840976, 3874204888, 6973568800, 34867844008, 62762119216, 313810596088, 564859072960, 2824295364808, 5083731656656, 25418658283288
OFFSET
1,1
FORMULA
a(n) = 10*9^((n-1)/2)-2 (n odd), 2*9^(n/2)-2 (n even).
a(1)=0, a(2)=8, a(3)=16, a(n)=a(n-1)+9*a(n-2)-9*a(n-3). - Harvey P. Dale, Jul 17 2012
G.f.: 8*x*(x+1) / ((x-1)*(3*x-1)*(3*x+1)). - Colin Barker, Apr 26 2015
a(n) = 8 * 3^(n-1) + 2 * (-3)^(n-1) - 2. - Robert Israel, Apr 26 2015
MAPLE
seq( 8 * 3^(n-1) + 2 * (-3)^(n-1) - 2, n=1..100); # Robert Israel, Apr 26 2015
MATHEMATICA
Table[If[OddQ[n], 10*9^((n-1)/2)-2, 2*9^(n/2)-2], {n, 0, 30}] (* or *) LinearRecurrence[ {1, 9, -9}, {0, 8, 16}, 30] (* Harvey P. Dale, Jul 17 2012 *)
PROG
(PARI) Vec(8*x*(x+1)/((x-1)*(3*x-1)*(3*x+1)) + O(x^100)) \\ Colin Barker, Apr 26 2015
CROSSREFS
Cf. A050250.
Sequence in context: A131539 A331419 A271080 * A291001 A062508 A083086
KEYWORD
nonn,base,easy
AUTHOR
Martin Renner, May 02 2006
EXTENSIONS
More terms from Harvey P. Dale, Jul 17 2012
STATUS
approved