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 A047240 #72 Jan 23 2025 16:28:56 %S A047240 0,1,2,6,7,8,12,13,14,18,19,20,24,25,26,30,31,32,36,37,38,42,43,44,48, %T A047240 49,50,54,55,56,60,61,62,66,67,68,72,73,74,78,79,80,84,85,86,90,91,92, %U A047240 96,97,98,102,103,104,108,109,110,114,115,116,120,121,122 %N A047240 Numbers that are congruent to {0, 1, 2} mod 6. %C A047240 Partial sums of 0,1,1,4,1,1,4,... - _Paul Barry_, Feb 19 2007 %C A047240 Numbers k such that floor(k/3) = 2*floor(k/6). - _Bruno Berselli_, Oct 05 2017 %H A047240 Vincenzo Librandi, <a href="/A047240/b047240.txt">Table of n, a(n) for n = 1..10000</a> %H A047240 Vladimir Pletser, <a href="http://arxiv.org/abs/1409.7969">Congruence conditions on the number of terms in sums of consecutive squared integers equal to squared integers</a>, arXiv:1409.7969 [math.NT], 2014. %H A047240 <a href="/index/Rec#order_04">Index entries for linear recurrences with constant coefficients</a>, signature (1,0,1,-1). %F A047240 From _Paul Barry_, Feb 19 2007: (Start) %F A047240 G.f.: x*(1 + x + 4*x^2)/((1 - x)*(1 - x^3)). %F A047240 a(n) = 2*n - 3 - cos(2*n*Pi/3) + sin(2*n*Pi/3)/sqrt(3). (End) %F A047240 a(n) = n-1 + 3*floor((n-1)/3). - _Philippe Deléham_, Apr 21 2009 %F A047240 a(n) = 6*floor(n/3) + (n mod 3). - _Gary Detlefs_, Mar 09 2010 %F A047240 a(n+1) = Sum_{k>=0} A030341(n,k)*b(k) with b(0)=1 and b(k)=2*3^k for k>0. - _Philippe Deléham_, Oct 22 2011. %F A047240 a(n) = 2*n - 2 - A010872(n-1). - _Wesley Ivan Hurt_, Jul 07 2013 %F A047240 From _Wesley Ivan Hurt_, Jun 14 2016: (Start) %F A047240 a(n) = a(n-1) + a(n-3) - a(n-4) for n>4. %F A047240 a(3*k) = 6*k-4, a(3*k-1) = 6*k-5, a(3*k-2) = 6*k-6. (End) %F A047240 Sum_{n>=2} (-1)^n/a(n) = (3-sqrt(3))*Pi/18 + log(2+sqrt(3))/(2*sqrt(3)). - _Amiram Eldar_, Dec 14 2021 %F A047240 E.g.f.: 4 + exp(x)*(2*x - 3) - exp(-x/2)*(3*cos(sqrt(3)*x/2) - sqrt(3)*sin(sqrt(3)*x/2))/3. - _Stefano Spezia_, Jul 26 2024 %p A047240 A047240:=n->2*n-3-cos(2*n*Pi/3)+sin(2*n*Pi/3)/sqrt(3): seq(A047240(n), n=1..100); # _Wesley Ivan Hurt_, Jun 14 2016 %p A047240 select(k -> modp(iquo(k,3), 2) = 0, [$0..122]); # _Peter Luschny_, Oct 05 2017 %t A047240 Select[Range[0, 200], Mod[#, 6] == 0 || Mod[#, 6] == 1 || Mod[#, 6] == 2 &] (* _Vladimir Joseph Stephan Orlovsky_, Jul 07 2011 *) %t A047240 a047240[n_] := Flatten[Map[6 # + {0, 1, 2} &, Range[0, n]]]; a047240[20] (* data *) (* _Hartmut F. W. Hoft_, Mar 06 2017 *) %o A047240 (Magma) [0] cat [6*Floor(n/3) + (n mod 3): n in [1..65]]; // _Vincenzo Librandi_, Oct 23 2011 %o A047240 (PARI) a(n)=n\3*6 + n%3 \\ _Charles R Greathouse IV_, Oct 07 2015 %o A047240 (Python) %o A047240 [k for k in range(123) if (k//3) % 2 == 0] # _Peter Luschny_, Oct 05 2017 %Y A047240 Cf. A010872, A030341, A047234, A047242. %Y A047240 Cf. similar sequences with formula n+i*floor(n/3) listed in A281899. %K A047240 nonn,easy %O A047240 1,3 %A A047240 _N. J. A. Sloane_ %E A047240 Paul Barry formula adapted for offset 1 by _Wesley Ivan Hurt_, Jun 14 2016