login
A037632
Base 4 digits are, in order, the first n terms of the periodic sequence with initial period 2,1,3.
1
2, 9, 39, 158, 633, 2535, 10142, 40569, 162279, 649118, 2596473, 10385895, 41543582, 166174329, 664697319, 2658789278, 10635157113, 42540628455, 170162513822, 680650055289, 2722600221159, 10890400884638, 43561603538553
OFFSET
1,1
FORMULA
G.f.: x*(2+x+3*x^2) / ( (x-1)*(4*x-1)*(1+x+x^2) ). - R. J. Mathar, Nov 21 2011
a(n) = 4*a(n-1) + a(n-3) - 4*a(n-4). - Vincenzo Librandi, Jun 17 2012
MATHEMATICA
LinearRecurrence[{4, 0, 1, -4}, {2, 9, 39, 158}, 40] (* Vincenzo Librandi, Jun 17 2012 *)
PROG
(Magma) I:=[2, 9, 39, 158]; [n le 4 select I[n] else 4*Self(n-1)+Self(n-3)-4*Self(n-4): n in [1..30]]; // Vincenzo Librandi, Jun 17 2012
CROSSREFS
Sequence in context: A070017 A054129 A037737 * A095939 A361358 A151009
KEYWORD
nonn,base
STATUS
approved