|
|
A135276
|
|
a(0)=0, a(1)=1; for n>1, a(n) = a(n-1) + n^0 if n odd, a(n) = a(n-1) + n^1 if n is even.
|
|
4
|
|
|
0, 1, 3, 4, 8, 9, 15, 16, 24, 25, 35, 36, 48, 49, 63, 64, 80, 81, 99, 100, 120, 121, 143, 144, 168, 169, 195, 196, 224, 225, 255, 256, 288, 289, 323, 324, 360, 361, 399, 400, 440, 441, 483, 484, 528, 529, 575, 576, 624, 625, 675, 676, 728, 729, 783, 784, 840, 841, 899, 900, 960, 961
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
0,3
|
|
COMMENTS
|
Index to family of sequences of the form a(n) = a(n-1) + n^r if n odd, a(n) = a(n-1)+ n^s if n is even, for n > 1 and a(1)=1:
s=0, s=1, s=2, s=3, s=4, s=5
|
|
LINKS
|
|
|
FORMULA
|
a(n) = (n/2 + 1)^2 - 1 if n is even, ((n+1)/2)^2 if n is odd. - M. F. Hasler, May 17 2008
G.f.: x*(1+2*x-x^2)/((1+x)^2*(1-x)^3).
a(n) = a(n-1) + 2*a(n-2) - 2*a(n-3) - a(n-4) + a(n-5). (End)
a(n) = (2*n^2 + 6*n + 1 + (2*n-1)*(-1)^n)/8. - Luce ETIENNE, Jul 08 2014
Sum_{n>=1} 1/a(n) = 3/4 + Pi^2/6. - Amiram Eldar, Sep 08 2022
|
|
MAPLE
|
|
|
MATHEMATICA
|
a = {}; r = 0; s = 1; Do[k = 0; Do[k = k + (Sin[Pi m/2]^2) m^r + (Cos[Pi m/2]^2) m^s, {m, 1, n}]; AppendTo[a, k], {n, 0, 100}]; a (* Artur Jasinski *)
LinearRecurrence[{1, 2, -2, -1, 1}, {0, 1, 3, 4, 8}, 50] (* G. C. Greubel, Oct 08 2016 *)
|
|
PROG
|
(PARI) my(x='x+O('x^200)); concat(0, Vec(x*(1+2*x-x^2)/((1+x)^2*(1-x)^3))) \\ Altug Alkan, Mar 23 2016
(Magma) [(2*n^2+6*n+1+(2*n-1)*(-1)^n)/8 : n in [0..100]]; // Wesley Ivan Hurt, Mar 22 2016
|
|
CROSSREFS
|
|
|
KEYWORD
|
nonn,easy
|
|
AUTHOR
|
|
|
EXTENSIONS
|
|
|
STATUS
|
approved
|
|
|
|