login
A037712
Base-7 digits are, in order, the first n terms of the periodic sequence with initial period 1,3,2,0.
2
1, 10, 72, 504, 3529, 24706, 172944, 1210608, 8474257, 59319802, 415238616, 2906670312, 20346692185, 142426845298, 996987917088, 6978915419616, 48852407937313, 341966855561194, 2393767988928360, 16756375922498520, 117294631457489641, 821062420202427490
OFFSET
1,2
FORMULA
a(n) = 8*a(n-1) - 8*a(n-2) + 8*a(n-3) - 7*a(n-4).
From Colin Barker, Dec 24 2015: (Start)
a(n) = 1/100*((2-11*i)*(-i)^n+(2+11*i)*i^n+3*7^(n+1)-25) where i=sqrt(-1).
G.f.: x*(1+2*x) / ((1-x)*(1-7*x)*(1+x^2)).
(End)
MATHEMATICA
Module[{nn=20, c}, c=PadRight[{}, nn, {1, 3, 2, 0}]; Table[FromDigits[ Take[ c, n], 7], {n, nn}]] (* or *) LinearRecurrence[{8, -8, 8, -7}, {1, 10, 72, 504}, 20] (* Harvey P. Dale, Jan 24 2014 *)
PROG
(PARI) Vec(x*(1+2*x)/((1-x)*(1-7*x)*(1+x^2)) + O(x^30)) \\ Colin Barker, Dec 24 2015
CROSSREFS
Sequence in context: A228310 A164546 A221552 * A037614 A138782 A155606
KEYWORD
nonn,base,easy
STATUS
approved