login
Numbers that are congruent to {0, 1, 4} mod 6.
9

%I #37 Jul 27 2024 12:37:50

%S 0,1,4,6,7,10,12,13,16,18,19,22,24,25,28,30,31,34,36,37,40,42,43,46,

%T 48,49,52,54,55,58,60,61,64,66,67,70,72,73,76,78,79,82,84,85,88,90,91,

%U 94,96,97,100,102,103,106,108,109,112,114,115,118,120,121,124

%N Numbers that are congruent to {0, 1, 4} mod 6.

%H Vincenzo Librandi, <a href="/A047234/b047234.txt">Table of n, a(n) for n = 1..1000</a>

%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, 3, 2, 1, 3, 2, 1, 3, 2, ...). - _Gary W. Adamson_, Jun 19 2008

%F G.f.: x^2*(1+x)*(2*x+1)/((1+x+x^2)*(x-1)^2). - _R. J. Mathar_, Oct 08 2011

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

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

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

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

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

%F E.g.f.: (6 + exp(x)*(6*x - 7) + exp(-x/2)*(cos(sqrt(3)*x/2) + sqrt(3)*sin(sqrt(3)*x/2)))/3. - _Stefano Spezia_, Jul 26 2024

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

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

%t LinearRecurrence[{1, 0, 1, -1}, {0, 1, 4, 6}, 100] (* _Vincenzo Librandi_, Jun 15 2016 *)

%t #+{0,1,4}&/@(6*Range[0,20])//Flatten (* _Harvey P. Dale_, Jul 25 2019 *)

%o (PARI) a(n)=(n-1)\3*6+[4,0,1][n%3+1] \\ _Charles R Greathouse IV_, Jun 11 2015

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

%Y Cf. A047240, A047242.

%K nonn,easy

%O 1,3

%A _N. J. A. Sloane_