Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).
%I #56 Aug 01 2023 19:41:39
%S 1,2,3,7,8,9,13,14,15,19,20,21,25,26,27,31,32,33,37,38,39,43,44,45,49,
%T 50,51,55,56,57,61,62,63,67,68,69,73,74,75,79,80,81,85,86,87,91,92,93,
%U 97,98,99,103,104,105,109,110,111,115,116,117,121,122,123
%N Numbers that are congruent to {1, 2, 3} mod 6.
%C a(k)^m is a term iff {a(k) is odd and m is a nonnegative integer} or {m is in A004273}. - _Jerzy R Borysowicz_, May 08 2023
%H David Lovler, <a href="/A047245/b047245.txt">Table of n, a(n) for n = 1..10000</a>
%H <a href="/index/Rec#order_04">Index entries for linear recurrences with constant coefficients</a>, signature (1,0,1,-1).
%F From _Johannes W. Meijer_, Jun 07 2011: (Start)
%F a(n) = ceiling(n/3) + ceiling((n-1)/3) + ceiling((n-2)/3) + 3*ceiling((n-3)/3).
%F G.f.: x*(1+x+x^2+3*x^3)/((x-1)^2*(x^2+x+1)). (End)
%F a(n) = 3*floor((n-1)/3) + n. - _Gary Detlefs_, Dec 22 2011
%F From _Wesley Ivan Hurt_, Apr 13 2015: (Start)
%F a(n) = a(n-1) + a(n-3) - a(n-4) for n>4.
%F a(n) = 2*n-3 + ((2*n-3) mod 3). (End)
%F From _Wesley Ivan Hurt_, Jun 13 2016: (Start)
%F a(n) = 2*n - 2 - cos(2*n*Pi/3) + sin(2*n*Pi/3)/sqrt(3).
%F a(3k) = 6k-3, a(3k-1) = 6k-4, a(3k-2) = 6k-5. (End)
%F Sum_{n>=1} (-1)^(n+1)/a(n) = (9-2*sqrt(3))*Pi/36 + log(2+sqrt(3))/(2*sqrt(3)) - log(2)/6. - _Amiram Eldar_, Dec 14 2021
%p A047245:=n->2*n-3+((2*n-3) mod 3): seq(A047245(n), n=1..100); # _Wesley Ivan Hurt_, Apr 13 2015
%t Select[Range[0, 200], Mod[#, 6] == 1 || Mod[#, 6] == 2 || Mod[#, 6] == 3 &] (* _Vladimir Joseph Stephan Orlovsky_, Jul 07 2011 *)
%t Flatten[Table[{6n + 1, 6n + 2, 6n + 3}, {n, 0, 19}]] (* _Alonso del Arte_, Jul 07 2011 *)
%t Select[Range[0, 200], MemberQ[{1, 2, 3}, Mod[#, 6]] &] (* _Vincenzo Librandi_, Apr 14 2015 *)
%o (Magma) [2*n-3+((2*n-3) mod 3) : n in [1..100]]; // _Wesley Ivan Hurt_, Apr 13 2015
%o (PARI) a(n) = 3*floor((n-1)/3) + n; \\ _David Lovler_, Aug 03 2022
%Y Cf. A047240, A047244, A047258 (complement).
%K nonn,easy
%O 1,2
%A _N. J. A. Sloane_