This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.
%I A047228 #41 Jul 27 2024 15:55:59 %S A047228 2,3,4,8,9,10,14,15,16,20,21,22,26,27,28,32,33,34,38,39,40,44,45,46, %T A047228 50,51,52,56,57,58,62,63,64,68,69,70,74,75,76,80,81,82,86,87,88,92,93, %U A047228 94,98,99,100,104,105,106,110,111,112,116,117,118,122,123,124 %N A047228 Numbers that are congruent to {2, 3, 4} mod 6. %C A047228 In other words, numbers that are divisible by 2 or by 3, but not by 6 (sorted). - _David James Sycamore_, Aug 22 2023 %H A047228 Vincenzo Librandi, <a href="/A047228/b047228.txt">Table of n, a(n) for n = 1..1000</a> %H A047228 <a href="/index/Rec#order_04">Index entries for linear recurrences with constant coefficients</a>, signature (1,0,1,-1). %F A047228 From _Paul Barry_, Sep 01 2009: (Start) %F A047228 G.f.: (2+x+x^2+2*x^3)/(1-x-x^3+x^4). %F A047228 a(n) = 2*n-1-cos(2*n*Pi/3)+sin(2*n*Pi/3)/sqrt(3). (End) [adapted for offset 1 by _Wesley Ivan Hurt_, Jun 13 2016] %F A047228 From _Wesley Ivan Hurt_, Jun 13 2016: (Start) %F A047228 a(n) = a(n-1) + a(n-3) - a(n-4) for n>4. %F A047228 a(3k) = 6k-2, a(3k-1) = 6k-3, a(3k-2) = 6k-4. (End) %F A047228 Sum_{n>=1} (-1)^(n+1)/a(n) = (4*sqrt(3)-3)*Pi/36. - _Amiram Eldar_, Dec 16 2021 %F A047228 E.g.f.: 2 + exp(x)*(2*x - 1) - exp(-x/2)*(3*cos(sqrt(3)*x/2) - sqrt(3)*sin(sqrt(3)*x/2))/3. - _Stefano Spezia_, Jul 26 2024 %e A047228 From _David A. Corneth_, Aug 22 2023: (Start) %e A047228 10 is in the sequence as 10 == 4 (mod 6) and 4 is in {2, 3, 4}. %e A047228 11 is not in the sequence as 11 == 5 (mod 6) and 5 is not in {2, 3, 4}. (End) %p A047228 A047228:=n->2*n-1-cos(2*n*Pi/3)+sin(2*n*Pi/3)/sqrt(3): seq(A047228(n), n=1..100); # _Wesley Ivan Hurt_, Jun 13 2016 %t A047228 Select[Range[0, 150], MemberQ[{2, 3, 4}, Mod[#, 6]]&] (* _Vincenzo Librandi_, Jan 06 2013 *) %o A047228 (Magma) [n: n in [0..120] | n mod 6 in [2..4]]; // _Vincenzo Librandi_, Jan 05 2013 %o A047228 (Haskell) %o A047228 a047228 n = a047228_list !! (n-1) %o A047228 a047228_list = 2 : 3 : 4 : map (+ 6) a047228_list %o A047228 -- _Reinhard Zumkeller_, Feb 19 2013 %o A047228 (PARI) a(n) = 6*((n-1)\3) + 2 + (n-1)%3 \\ _David A. Corneth_, Aug 22 2023 %o A047228 (PARI) nxt(n) = if(n%3 == 1, n+4, n+1) \\ _David A. Corneth_, Aug 22 2023 %Y A047228 Cf. A007310, A047241, A047261, A047273, A097451. %K A047228 nonn,easy %O A047228 1,1 %A A047228 _N. J. A. Sloane_