OFFSET
0,3
COMMENTS
Each term is the sum of an ascending diagonal of the triangle A162609.
LINKS
Andrew Howroyd, Table of n, a(n) for n = 0..1000
Eddie Gutierrez, The Wheel Octagon Triangle - Ascending Diagonals (Part VIIIb)
Index entries for linear recurrences with constant coefficients, signature (1,3,-3,-3,3,1,-1).
FORMULA
a(n) = (n^3 + 2*n + 12)/12, for even n.
a(n) = (2*n^3 - 3*n^2 + 10*n + 15)/24, for odd n.
G.f.: (1 - 2*x^2 + x^3 + 4*x^4)/((1 - x)^4*(1 + x)^3). - Andrew Howroyd, Nov 15 2025
E.g.f.: ((24 + 9*x + 6*x^2 + 2*x^3)*cosh(x) + (15 + 6*x + 3*x^2 + 2*x^3)*sinh(x))/24. - Stefano Spezia, Nov 15 2025
EXAMPLE
a(4) = (64 + 8 + 12)/12 = 7
a(5) = (250 - 75 + 50 + 15)/24 = 10.
PROG
(C) // Calculates and prints out the triangle and terms of ascending diagonals (on first line). To get more terms increment j.
#include <stdio.h>
int main()
{
int n, j=8, k, C, F1, F2, s;
F1=1; F2=1;
printf("%d ", F1);
printf("%d ", F2);
for (s=0; s<=j; s++)
{
F1=F1 + 2*s*s + 2*s + 1;
F2=F2 + 2*s*s + 3*s + 2;
printf("%d ", F1);
printf("%d ", F2);
}
printf("\n");
return 0;
}
(PARI) a(n) = if (n%2, 2*n^3 - 3*n^2 + 10*n + 15, 2*(n^3 + 2*n + 12))/24; \\ Andrew Howroyd, Nov 15 2025
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Eddie Gutierrez, May 05 2022
STATUS
approved
