login

Reminder: The OEIS is hiring a new managing editor, and the application deadline is January 26.

Numbers that are congruent to {0, 2, 3} mod 6.
3

%I #36 Sep 08 2022 08:44:56

%S 0,2,3,6,8,9,12,14,15,18,20,21,24,26,27,30,32,33,36,38,39,42,44,45,48,

%T 50,51,54,56,57,60,62,63,66,68,69,72,74,75,78,80,81,84,86,87,90,92,93,

%U 96,98,99,102,104,105,108,110,111,114,116,117,120,122,123

%N Numbers that are congruent to {0, 2, 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 G.f.: x^2*(2+x+3*x^2) / ((1+x+x^2)*(x-1)^2). - _R. J. Mathar_, Oct 08 2011

%F From _Wesley Ivan Hurt_, Jun 13 2016: (Start)

%F a(n) = a(n-1) + a(n-3) - a(n-4) for n>4.

%F a(n) = (6*n-7-2*cos(2*n*Pi/3))/3.

%F a(3k) = 6k-3, a(3k-1) = 6k-4, a(3k-2) = 6k-6. (End)

%F E.g.f.: (9 + (6*x - 7)*exp(x) - 2*cos(sqrt(3)*x/2)*(cosh(x/2) - sinh(x/2)))/3. - _Ilya Gutkovskiy_, Jun 14 2016

%F Sum_{n>=2} (-1)^n/a(n) = (3-sqrt(3))*Pi/18 + log(2+sqrt(3))/(2*sqrt(3)) + log(2)/3. - _Amiram Eldar_, Dec 14 2021

%p A047244:=n->(6*n-7-2*cos(2*n*Pi/3))/3: seq(A047244(n), n=1..100); # _Wesley Ivan Hurt_, Jun 13 2016

%t Select[Range[0, 200], Mod[#, 6] == 0 || Mod[#, 6] == 2 || Mod[#, 6] == 3 &] (* _Vladimir Joseph Stephan Orlovsky_, Jul 07 2011 *)

%t Select[Range[0, 200], MemberQ[{0, 2, 3}, Mod[#, 6]] &] (* _Vincenzo Librandi_, Oct 02 2015 *)

%t LinearRecurrence[{1, 0, 1, -1}, {2, 3, 6, 8}, {0, 20}] (* _Eric W. Weisstein_, Apr 09 2018 *)

%t CoefficientList[Series[x (2 + x + 3 x^2)/((-1 + x)^2 (1 + x + x^2)), {x, 0, 20}], x] (* _Eric W. Weisstein_, Apr 09 2018 *)

%t Table[(6 n + Cos[2 n Pi/3] + Sqrt[3] Sin[2 n Pi/3] - 1)/3, {n, 0, 20}] (* _Eric W. Weisstein_, Apr 09 2018 *)

%o (PARI) isok(n) = my(m = n % 6); (m==0) || (m==2) || (m==3); \\ _Michel Marcus_, Oct 02 2015

%o (Magma) [n : n in [0..130] | n mod 6 in [0, 2, 3]]; // _Vincenzo Librandi_, Oct 02 2015

%Y Cf. A047240, A047242.

%K nonn,easy

%O 1,2

%A _N. J. A. Sloane_