login
A363269
Positive squares (A000290) alternating with positive square pyramidal numbers (A000330).
4
1, 1, 4, 5, 9, 14, 16, 30, 25, 55, 36, 91, 49, 140, 64, 204, 81, 285, 100, 385, 121, 506, 144, 650, 169, 819, 196, 1015, 225, 1240, 256, 1496, 289, 1785, 324, 2109, 361, 2470, 400, 2870, 441, 3311, 484, 3795, 529, 4324, 576, 4900, 625, 5525, 676, 6201, 729
OFFSET
1,3
FORMULA
a(n) = 4*a(n-2) - 6*a(n-4) + 4*a(n-6) - a(n-8).
G.f.: x*(1 + x + x^3 - x^4)/(-1 + x^2)^4.
E.g.f.: ((18*x + 6*x^2)*cosh(x) + (6 + 6*x + 6*x^2 + x^3)*sinh(x))/24. - Stefano Spezia, Jun 10 2023
48*a(n) = (n+1) * (n^2 +(-1)^n*n^2 -4*(-1)^n*n +8*n -6*(-1)^n +6). - R. J. Mathar, Jun 22 2023
MATHEMATICA
c[1] = 1; c[2] = 1;
c[n_] := If[OddQ[n], c[n - 2] + n, c[n - 2] + c[n - 1]]
Table[c[n], {n, 1, 120}]
PROG
(PARI) a(n) = if(n%2, (n+1)^2/4, n*(n+1)*(n+2)/24); \\ Kevin Ryde, Jun 10 2023
CROSSREFS
Range of terms: A363284\{0}.
Sequence in context: A038099 A243166 A363284 * A120740 A274282 A347553
KEYWORD
nonn,easy
AUTHOR
Clark Kimberling, May 24 2023
STATUS
approved