A117863 Number of palindromes (in base 4) below 4^n.
3, 6, 18, 30, 78, 126, 318, 510, 1278, 2046, 5118, 8190, 20478, 32766, 81918, 131070, 327678, 524286, 1310718, 2097150, 5242878, 8388606, 20971518, 33554430, 83886078, 134217726, 335544318, 536870910, 1342177278, 2147483646, 5368709118, 8589934590
Offset: 1
Links
- Harvey P. Dale, Table of n, a(n) for n = 1..1000
- Index entries for linear recurrences with constant coefficients, signature (1,4,-4).
Crossrefs
Cf. A050250.
Programs
-
Mathematica
Rest[CoefficientList[Series[3x (x+1)/((x-1)(2x-1)(2x+1)),{x,0,40}],x]] (* or *) LinearRecurrence[{1,4,-4},{3,6,18},40] (* Harvey P. Dale, May 09 2013 *)
Formula
a(n) = 5*4^((n-1)/2)-2 (n odd), 2*4^(n/2)-2 (n even).
G.f.: 3*x*(x+1) / ((x-1)*(2*x-1)*(2*x+1)). [Colin Barker, Feb 15 2013]
a(1)=3, a(2)=6, a(3)=18, a(n)=a(n-1)+4*a(n-2)-4*a(n-3). - Harvey P. Dale, May 09 2013
Extensions
More terms from Colin Barker, Feb 15 2013