cp's OEIS Frontend

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.

A217571 a(n) = (2*n*(n+5) + (2*n+1)*(-1)^n - 1)/8.

This page as a plain text file.
%I A217571 #77 Sep 08 2022 08:46:04
%S A217571 1,4,5,10,11,18,19,28,29,40,41,54,55,70,71,88,89,108,109,130,131,154,
%T A217571 155,180,181,208,209,238,239,270,271,304,305,340,341,378,379,418,419,
%U A217571 460,461,504,505,550,551,598,599,648,649,700,701,754,755,810,811,868
%N A217571 a(n) = (2*n*(n+5) + (2*n+1)*(-1)^n - 1)/8.
%C A217571 One of four sequences given by classifying natural numbers according to the value of floor(sqrt(n)). See Sato link and sequences A005563, A217570, A217575.
%C A217571 Numbers n such that floor(sqrt(n)) = floor(n/floor(sqrt(n))) = floor(n/(floor(sqrt(n)) + 2)) + 1.
%H A217571 Vincenzo Librandi, <a href="/A217571/b217571.txt">Table of n, a(n) for n = 1..1000</a>
%H A217571 Takumi Sato, <a href="https://web.archive.org/web/20140103114324/http://vixra.org/abs/1210.0025">Classification of Natural Numbers</a> [Wayback Machine link]
%H A217571 <a href="/index/Rec#order_05">Index entries for linear recurrences with constant coefficients</a>, signature (1,2,-2,-1,1).
%F A217571 G.f.: x*(1+3*x-x^2-x^3)/((1+x)^2*(1-x)^3). - _Bruno Berselli_, Oct 11 2012
%F A217571 From _Stefano Spezia_, Dec 14 2019: (Start)
%F A217571 E.g.f.: (x*(5+x)*cosh(x) - (1-7*x-x^2)*sinh(x))/4.
%F A217571 a(n) = a(n-1) + 1 for n odd.
%F A217571 a(n) = a(n-1) + n + 1 for n even.
%F A217571 a(2*n) = A028552(n).
%F A217571 a(2*n+1) = A028387(n).
%F A217571 (End)
%e A217571 From _Stefano Spezia_, Dec 14 2019: (Start)
%e A217571 Illustration of the initial terms:
%e A217571 o      o        o        o           o
%e A217571      o o o    o o o    o o o       o o o
%e A217571                 o        o           o
%e A217571                      o o o o o   o o o o o
%e A217571                                      o
%e A217571 (1)   (4)      (5)     (10)        (11)
%e A217571 (End)
%p A217571 seq( (2*n^2 +10*n -1 +(-1)^n*(2*n+1))/8, n=1..60); # _G. C. Greubel_, Dec 19 2019
%t A217571 CoefficientList[Series[(1 + 3*x - x^2 - x^3)/((1 + x)^2*(1 - x)^3), {x, 0, 40}], x] (* _Vincenzo Librandi_, Dec 15 2012 *)
%t A217571 a[1]=1;a[n_]:=If[EvenQ[n],a[n-1]+1+n,a[n-1]+1]; Array[a,56] (* _Stefano Spezia_, Dec 18 2019 *)
%o A217571 (Visual Basic in Excel)
%o A217571 Sub A217571()
%o A217571 Dim x As Long, n As Long, y As Long, i As Long
%o A217571 x = InputBox("Count to")
%o A217571 For n = 1 To x
%o A217571 y = Int(Sqr(n))
%o A217571 If y = Int(n / y) Then GoTo L1
%o A217571 GoTo L2
%o A217571 L1: If y = Int(n / (y + 2)) + 1 Then
%o A217571 i = i + 1
%o A217571 Cells(i, 1) = n
%o A217571 End If
%o A217571 L2: Next n
%o A217571 End Sub
%o A217571 (Magma) [n: n in [1..900] | Floor(n/Isqrt(n)) eq Floor(n/(Isqrt(n)+2))+1]; // _Bruno Berselli_, Oct 10 2012
%o A217571 (Maxima) makelist((2*n*(n+5)+(2*n+1)*(-1)^n-1)/8, n, 1, 56); /* _Martin Ettl_, Oct 15 2012 */
%o A217571 (Magma) I:=[1, 4, 5, 10, 11]; [n le 5 select I[n] else Self(n-1) + 2*Self(n-2) - 2*Self(n-3) - Self(n-4) + Self(n-5): n in [1..60]]; // _Vincenzo Librandi_, Dec 15 2012
%o A217571 (PARI) vector(60, n, (2*n^2 +10*n -1 +(-1)^n*(2*n+1))/8 ) \\ _G. C. Greubel_, Dec 19 2019
%o A217571 (Sage) [(2*n^2 +10*n -1 +(-1)^n*(2*n+1))/8 for n in (1..60)] # _G. C. Greubel_, Dec 19 2019
%o A217571 (GAP) List([1..60], n-> (2*n^2 +10*n -1 +(-1)^n*(2*n+1))/8 ); # _G. C. Greubel_, Dec 19 2019
%Y A217571 Cf. A005563, A028387, A028552, A217570, A217575.
%K A217571 nonn,easy
%O A217571 1,2
%A A217571 _Takumi Sato_, Oct 07 2012
%E A217571 Definition by _Bruno Berselli_, Oct 11 2012