OFFSET
1,2
LINKS
Index entries for linear recurrences with constant coefficients, signature (8,0,1,-8).
FORMULA
a(n) = 8*a(n-1) + a(n-3) - 8*a(n-4).
a(n) = floor( (65/511)*8^n ). - Tani Akinari, Jul 15 2014
G.f.: x*(x^2+1) / ((x-1)*(8*x-1)*(x^2+x+1)). - Colin Barker, Jul 17 2014
EXAMPLE
The first six terms have base 8 representations 1, 10, 101, 1011, 10110, 101101.
MAPLE
A033126 := proc(n)
coeftayl( x*(x^2+1) / ((x-1)*(8*x-1)*(x^2+x+1)), x=0, n) ;
end proc:
seq(A033126(n), n=1..30); # Wesley Ivan Hurt, Jul 17 2014
MATHEMATICA
CoefficientList[Series[(x^2 + 1)/((x - 1)*(8*x - 1)*(x^2 + x + 1)), {x, 0, 30}], x] (* Wesley Ivan Hurt, Jul 17 2014 *)
Table[FromDigits[PadRight[{}, n, {1, 0, 1}], 8], {n, 30}] (* or *) LinearRecurrence[ {8, 0, 1, -8}, {1, 8, 65, 521}, 30] (* Harvey P. Dale, Sep 14 2016 *)
PROG
(PARI) a(n)=(65*8^n)\511; \\ Michel Marcus, Jul 16 2014
(Magma) [Floor( (65/511)*8^n ) : n in [1..30]]; // Wesley Ivan Hurt, Jul 17 2014
CROSSREFS
KEYWORD
nonn,base,easy
AUTHOR
EXTENSIONS
More terms from Michel Marcus, Jul 16 2014
STATUS
approved