OFFSET
1,3
LINKS
Index entries for linear recurrences with constant coefficients, signature (1,0,1,-1).
FORMULA
Partial sums of (0, 1, 2, 4, 1, 2, 4, 1, 2, 4, ...). - Gary W. Adamson, Jun 19 2008
G.f.: x^2*(1+2*x+4*x^2)/((1+x+x^2)*(x-1)^2). - R. J. Mathar, Dec 04 2011
From Wesley Ivan Hurt, Jun 08 2016: (Start)
a(n) = a(n-1) + a(n-3) - a(n-4) for n>4.
a(n) = (21*n-30-6*cos(2*n*Pi/3)+4*sqrt(3)*sin(2*n*Pi/3))/9.
a(3k) = 7k-4, a(3k-1) = 7k-6, a(3k-2) = 7k-7. (End)
MAPLE
A047357:=n->(21*n-30-6*cos(2*n*Pi/3)+4*sqrt(3)*sin(2*n*Pi/3))/9: seq(A047357(n), n=1..100); # Wesley Ivan Hurt, Jun 08 2016
MATHEMATICA
Select[Range[0, 200], Mod[#, 7] == 0 || Mod[#, 7] == 1 || Mod[#, 7] == 3 &] (* Vladimir Joseph Stephan Orlovsky, Jul 10 2011 *)
Select[Range[0, 200], MemberQ[{0, 1, 3}, Mod[#, 7]]&] (* Harvey P. Dale, Nov 30 2012 *)
Accumulate[PadRight[{0}, 70, {4, 1, 2}]] (* Harvey P. Dale, Aug 16 2021 *)
PROG
(Magma) [n : n in [0..150] | n mod 7 in [0, 1, 3]]; // Wesley Ivan Hurt, Jun 08 2016
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
STATUS
approved