Reminder: The OEIS is hiring a new managing editor, and the application deadline is January 26.
%I #40 Jul 26 2024 15:46:37
%S 0,1,3,6,7,9,12,13,15,18,19,21,24,25,27,30,31,33,36,37,39,42,43,45,48,
%T 49,51,54,55,57,60,61,63,66,67,69,72,73,75,78,79,81,84,85,87,90,91,93,
%U 96,97,99,102,103,105,108,109,111,114,115,117,120,121,123
%N Numbers that are congruent to {0, 1, 3} mod 6.
%H <a href="/index/Rec#order_04">Index entries for linear recurrences with constant coefficients</a>, signature (1,0,1,-1).
%F Equals partial sums of (0, 1, 2, 3, 1, 2, 3, 1, 2, 3, ...). - _Gary W. Adamson_, Jun 19 2008
%F G.f.: x^2*(1+2*x+3*x^2)/((1+x+x^2)*(x-1)^2). - _R. J. Mathar_, Oct 08 2011
%F A214090(a(n)) = 0. - _Reinhard Zumkeller_, Jul 06 2012
%F a(n) = a(n-1) + a(n-3) - a(n-4), n>4. - _Wesley Ivan Hurt_, Dec 03 2014
%F a(n) = n-1 + floor((n-1)/3) + floor((2n-2)/3). - _Wesley Ivan Hurt_, Dec 03 2014
%F From _Wesley Ivan Hurt_, Jun 13 2016: (Start)
%F a(n) = (6*n-8-cos(2*n*Pi/3)+sqrt(3)*sin(2*n*Pi/3))/3.
%F a(3k) = 6k-3, a(3k-1) = 6k-5, a(3k-2) = 6k-6. (End)
%F a(n) = 2*n - 2 - sign((n-1) mod 3). - _Wesley Ivan Hurt_, Sep 26 2017
%F Sum_{n>=2} (-1)^n/a(n) = Pi/12 + log(2)/6 + log(2+sqrt(3))/(2*sqrt(3)). - _Amiram Eldar_, Dec 14 2021
%F 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
%p 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
%t Select[Range[0, 200], Mod[#, 6] == 0 || Mod[#, 6] == 1 || Mod[#, 6] == 3 &] (* _Vladimir Joseph Stephan Orlovsky_, Jul 07 2011 *)
%o (Haskell)
%o a047242 n = a047242_list !! n
%o a047242_list = elemIndices 0 a214090_list
%o -- _Reinhard Zumkeller_, Jul 06 2012
%o (Magma) [n-1+Floor((n-1)/3)+Floor((2*n-2)/3) : n in [1..50]]; // _Wesley Ivan Hurt_, Dec 03 2014
%Y Cf. A047234, A047240, A214090.
%Y Cf. A047261 (complement).
%K nonn,easy
%O 1,3
%A _N. J. A. Sloane_