OFFSET
1,3
LINKS
Index entries for linear recurrences with constant coefficients, signature (1,0,1,-1).
FORMULA
Equals partial sums of (0, 1, 2, 3, 1, 2, 3, 1, 2, 3, ...). - Gary W. Adamson, Jun 19 2008
G.f.: x^2*(1+2*x+3*x^2)/((1+x+x^2)*(x-1)^2). - R. J. Mathar, Oct 08 2011
A214090(a(n)) = 0. - Reinhard Zumkeller, Jul 06 2012
a(n) = a(n-1) + a(n-3) - a(n-4), n>4. - Wesley Ivan Hurt, Dec 03 2014
a(n) = n-1 + floor((n-1)/3) + floor((2n-2)/3). - Wesley Ivan Hurt, Dec 03 2014
From Wesley Ivan Hurt, Jun 13 2016: (Start)
a(n) = (6*n-8-cos(2*n*Pi/3)+sqrt(3)*sin(2*n*Pi/3))/3.
a(3k) = 6k-3, a(3k-1) = 6k-5, a(3k-2) = 6k-6. (End)
a(n) = 2*n - 2 - sign((n-1) mod 3). - Wesley Ivan Hurt, Sep 26 2017
Sum_{n>=2} (-1)^n/a(n) = Pi/12 + log(2)/6 + log(2+sqrt(3))/(2*sqrt(3)). - Amiram Eldar, Dec 14 2021
E.g.f.: (9 + exp(x)*(6*x - 8) - exp(-x/2)*(cos(sqrt(3)*x/2) - sqrt(3)*sin(sqrt(3)*x/2)))/3. - Stefano Spezia, Jul 26 2024
MAPLE
A047242:=n->n-1+floor((n-1)/3)+floor((2*n-2)/3): seq(A047242(n), n=1..50); # Wesley Ivan Hurt, Dec 03 2014
MATHEMATICA
Select[Range[0, 200], Mod[#, 6] == 0 || Mod[#, 6] == 1 || Mod[#, 6] == 3 &] (* Vladimir Joseph Stephan Orlovsky, Jul 07 2011 *)
PROG
(Haskell)
a047242 n = a047242_list !! n
a047242_list = elemIndices 0 a214090_list
-- Reinhard Zumkeller, Jul 06 2012
(Magma) [n-1+Floor((n-1)/3)+Floor((2*n-2)/3) : n in [1..50]]; // Wesley Ivan Hurt, Dec 03 2014
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
STATUS
approved