A359366 a(n) = (1/8)*(((3*n + 1) + (n - 1)*(-1)^n)*(n + 1)).
0, 1, 3, 4, 10, 9, 21, 16, 36, 25, 55, 36, 78, 49, 105, 64, 136, 81, 171, 100, 210, 121, 253, 144, 300, 169, 351, 196, 406, 225, 465, 256, 528, 289, 595, 324, 666, 361, 741, 400, 820, 441, 903, 484, 990, 529, 1081, 576, 1176, 625, 1275, 676, 1378, 729, 1485
Offset: 0
Links
- Daniel Mondot, Table of n, a(n) for n = 0..9999
- Index entries for linear recurrences with constant coefficients, signature (0,3,0,-3,0,1).
Programs
-
Maple
a := n -> (1/8)*(((3*n + 1) + (n - 1)*(-1)^n)*(n + 1)): # Or: a := n -> ifelse(irem(n, 2) = 1, ((n + 1) / 2)^2, (n^2 + n)/2): seq(a(n), n = 0..54);
-
Mathematica
a[n_] := (1/8)*(((3*n + 1) + (n - 1)*(-1)^n)*(n + 1)); Array[a,55,0] (* Stefano Spezia, Apr 28 2025 *)
Formula
a(n) = ((n + 1) / 2)^2 if n is odd, otherwise (n^2 + n) / 2.
a(n) = [x^n] -(x*(x^3 + x^2 + 3*x + 1))/(x^2 - 1)^3.
a(n) = n! * [x^n] (1/4)*((1 + x*(x + 4))*sinh(x) + x*(2*x + 3)*cosh(x)).