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