login
A037489
Base 4 digits are, in order, the first n terms of the periodic sequence with initial period 2,1.
1
2, 9, 38, 153, 614, 2457, 9830, 39321, 157286, 629145, 2516582, 10066329, 40265318, 161061273, 644245094, 2576980377, 10307921510, 41231686041, 164926744166, 659706976665, 2638827906662, 10555311626649, 42221246506598
OFFSET
1,1
FORMULA
a(n) = 4a(n-1) + a(n-2) - 4a(n-3).
G.f.: x*(2+x) / ( (x-1)*(4*x-1)*(1+x) ). - R. J. Mathar, Nov 21 2011
MATHEMATICA
LinearRecurrence[{4, 1, -4}, {2, 9, 38}, 40] (* Vincenzo Librandi, Jun 22 2012 *)
PROG
(Magma) I:=[2, 9, 38]; [n le 3 select I[n] else 4*Self(n-1)+Self(n-2)-4*Self(n-3): n in [1..30]]; // Vincenzo Librandi, Jun 22 2012
CROSSREFS
Sequence in context: A007224 A181339 A291265 * A037569 A291462 A001077
KEYWORD
nonn,base,easy
STATUS
approved