login
Numbers that are congruent to {3, 4, 5} mod 6.
1

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

%S 3,4,5,9,10,11,15,16,17,21,22,23,27,28,29,33,34,35,39,40,41,45,46,47,

%T 51,52,53,57,58,59,63,64,65,69,70,71,75,76,77,81,82,83,87,88,89,93,94,

%U 95,99,100,101,105,106,107,111,112,113,117,118,119,123,124

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

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

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

%F a(n) = 2*n-cos(2*n*Pi/3)+sin(2*n*Pi/3)/sqrt(3).

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

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

%p A047249:=n->2*n-cos(2*n*Pi/3)+sin(2*n*Pi/3)/sqrt(3): seq(A047249(n), n=1..100); # _Wesley Ivan Hurt_, Jun 10 2016

%t Select[Range[150], MemberQ[{3,4,5}, Mod[#,6]]&] (* _Harvey P. Dale_, Nov 21 2012 *)

%o (Magma) [n : n in [0..150] | n mod 6 in [3..5]]; // _Wesley Ivan Hurt_, Jun 10 2016

%K nonn,easy

%O 1,1

%A _N. J. A. Sloane_