OFFSET
1,2
LINKS
Index entries for linear recurrences with constant coefficients, signature (1,0,1,-1).
FORMULA
G.f.: x*(1+2*x+x^2+x^3)/((1-x)^2*(1+x+x^2)).
a(n) = a(n-1) + a(n-3) - a(n-4) for n>4.
a(n) = 1+(5*n)/3-(i*sqrt(3) * (-1/2+(i*sqrt(3))/2)^n)/9+(i*sqrt(3)* (-1/2-(i*sqrt(3))/2)^n)/9. - Stephen Crowley, Feb 11 2007
a(n) = floor((5*n-1)/3). - Gary Detlefs, May 14 2011
From Wesley Ivan Hurt, Jun 14 2016: (Start)
a(n) = (15*n-6-3*cos(2*n*Pi/3)-sqrt(3)*sin(2*n*Pi/3))/9.
a(3k) = 5k-1, a(3k-1) = 5k-2, a(3k-2) = 5k-4. (End)
Sum_{n>=1} (-1)^(n+1)/a(n) = sqrt((5-sqrt(5))/2)*Pi/5 + log(phi)/sqrt(5) - log(2)/5, where phi is the golden ratio (A001622). - Amiram Eldar, Apr 16 2023
E.g.f.: (9 + 3*exp(x)*(5*x - 2) - exp(-x/2)*(3*cos(sqrt(3)*x/2) + sqrt(3)*sin(sqrt(3)*x/2)))/9. - Stefano Spezia, Jun 22 2024
MAPLE
A047206:=n->(15*n-6-3*cos(2*n*Pi/3)-sqrt(3)*sin(2*n*Pi/3))/9: seq(A047206(n), n=1..100); # Wesley Ivan Hurt, Jun 14 2016
MATHEMATICA
Select[Range[0, 200], MemberQ[{1, 3, 4}, Mod[#, 5]] &] (* Vladimir Joseph Stephan Orlovsky, Feb 12 2012 *)
PROG
(Magma) [ n : n in [1..150] | n mod 5 in [1, 3, 4] ]; // Vincenzo Librandi, Mar 31 2011
(PARI) a(n)=(5*n-1)\3 \\ Charles R Greathouse IV, Jul 01 2013
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
STATUS
approved