OFFSET
0,3
COMMENTS
Each term is the sum of an ascending diagonal of the triangle A162609.
LINKS
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.
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;
}
CROSSREFS
KEYWORD
nonn
AUTHOR
Eddie Gutierrez, May 05 2022
STATUS
approved