OFFSET
0,3
LINKS
Colin Barker, Table of n, a(n) for n = 0..1000
Index entries for linear recurrences with constant coefficients, signature (0,0,5,0,0,-4).
FORMULA
From Colin Barker, May 14 2016: (Start)
a(n) = 5*a(n-3)-4*a(n-6) for n>5.
G.f.: x*(1+x)*(1+x+2*x^2) / ((1-x)*(1+x+x^2)*(1-4*x^3)).
(End)
MATHEMATICA
f[n_] := FromDigits[ RotateRight[ IntegerDigits[n, 2]], 2] - FromDigits[ RotateLeft[ IntegerDigits[n, 2]], 2]; Select[ Range[33560000], f[ # ] == 0 &]
(* Or *) Union[ Join[ Table[2^n - 1, {n, 0, 25}], Table[ Ceiling[2(2^n - 1)/3], {n, 2, 24, 2}]]]
LinearRecurrence[{0, 0, 5, 0, 0, -4}, {0, 1, 2, 3, 7, 10}, 40] (* Harvey P. Dale, Feb 20 2022 *)
PROG
(PARI) concat(0, Vec(x*(1+x)*(1+x+2*x^2) / ((1-x)*(1+x+x^2)*(1-4*x^3)) + O(x^50))) \\ Colin Barker, May 14 2016
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Robert G. Wilson v, Sep 13 2003
STATUS
approved