A217571 a(n) = (2*n*(n+5) + (2*n+1)*(-1)^n - 1)/8.
1, 4, 5, 10, 11, 18, 19, 28, 29, 40, 41, 54, 55, 70, 71, 88, 89, 108, 109, 130, 131, 154, 155, 180, 181, 208, 209, 238, 239, 270, 271, 304, 305, 340, 341, 378, 379, 418, 419, 460, 461, 504, 505, 550, 551, 598, 599, 648, 649, 700, 701, 754, 755, 810, 811, 868
Offset: 1
Examples
From _Stefano Spezia_, Dec 14 2019: (Start) Illustration of the initial terms: o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o (1) (4) (5) (10) (11) (End)
Links
- Vincenzo Librandi, Table of n, a(n) for n = 1..1000
- Takumi Sato, Classification of Natural Numbers [Wayback Machine link]
- Index entries for linear recurrences with constant coefficients, signature (1,2,-2,-1,1).
Programs
-
GAP
List([1..60], n-> (2*n^2 +10*n -1 +(-1)^n*(2*n+1))/8 ); # G. C. Greubel, Dec 19 2019
-
Magma
[n: n in [1..900] | Floor(n/Isqrt(n)) eq Floor(n/(Isqrt(n)+2))+1]; // Bruno Berselli, Oct 10 2012
-
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
-
Maple
seq( (2*n^2 +10*n -1 +(-1)^n*(2*n+1))/8, n=1..60); # G. C. Greubel, Dec 19 2019
-
Mathematica
CoefficientList[Series[(1 + 3*x - x^2 - x^3)/((1 + x)^2*(1 - x)^3), {x, 0, 40}], x] (* Vincenzo Librandi, Dec 15 2012 *) 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 *)
-
Maxima
makelist((2*n*(n+5)+(2*n+1)*(-1)^n-1)/8, n, 1, 56); /* Martin Ettl, Oct 15 2012 */
-
PARI
vector(60, n, (2*n^2 +10*n -1 +(-1)^n*(2*n+1))/8 ) \\ G. C. Greubel, Dec 19 2019
-
Sage
[(2*n^2 +10*n -1 +(-1)^n*(2*n+1))/8 for n in (1..60)] # G. C. Greubel, Dec 19 2019
Formula
G.f.: x*(1+3*x-x^2-x^3)/((1+x)^2*(1-x)^3). - Bruno Berselli, Oct 11 2012
From Stefano Spezia, Dec 14 2019: (Start)
E.g.f.: (x*(5+x)*cosh(x) - (1-7*x-x^2)*sinh(x))/4.
a(n) = a(n-1) + 1 for n odd.
a(n) = a(n-1) + n + 1 for n even.
a(2*n) = A028552(n).
a(2*n+1) = A028387(n).
(End)
Extensions
Definition by Bruno Berselli, Oct 11 2012
Comments