A117868 Number of palindromes (in base 9) below 9^n.
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
Links
- Colin Barker, Table of n, a(n) for n = 1..1000
- Index entries for linear recurrences with constant coefficients, signature (1,9,-9).
Crossrefs
Cf. A050250.
Programs
-
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 *)
-
PARI
Vec(8*x*(x+1)/((x-1)*(3*x-1)*(3*x+1)) + O(x^100)) \\ Colin Barker, Apr 26 2015
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
Extensions
More terms from Harvey P. Dale, Jul 17 2012