|
|
A071289
|
|
a(n) = n*(n^2 + 1) if n is even, otherwise (n - 1/2)*(n^2 + 1).
|
|
1
|
|
|
0, 1, 10, 25, 68, 117, 222, 325, 520, 697, 1010, 1281, 1740, 2125, 2758, 3277, 4112, 4785, 5850, 6697, 8020, 9061, 10670, 11925, 13848, 15337, 17602, 19345, 21980, 23997, 27030, 29341, 32800, 35425, 39338, 42297, 46692, 50005, 54910, 58597, 64040, 68121, 74130
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
0,3
|
|
COMMENTS
|
Sum of the numbers along the diagonals of an n X n square array whose elements are the numbers from 1..n^2, listed in increasing order by rows (see example). - Wesley Ivan Hurt, May 15 2021
|
|
REFERENCES
|
T. A. Gulliver, Sequences from Arrays of Integers, Int. Math. Journal, Vol. 1, No. 4, pp. 323-332, 2002.
|
|
LINKS
|
|
|
FORMULA
|
a(n) = a(n-1) + 3*a(n-2) - 3*a(n-3) - 3*a(n-4) + 3*a(n-5) + a(n-6) - a(n-7).
G.f.: x*(1 + 9*x + 12*x^2 + 16*x^3 + 7*x^4 + 3*x^5)/((1+x)^3*(1-x)^4). (End)
E.g.f.: (1/4)*( (1 - x + x^2)*exp(-x) + (-1 + 7*x + 11*x^2 + 4*x^3)*exp(x) ). - G. C. Greubel, Mar 29 2024
|
|
EXAMPLE
|
[1 2 3 4 5]
[1 2 3 4] [6 7 8 9 10]
[1 2 3] [5 6 7 8] [11 12 13 14 15]
[1 2] [4 5 6] [9 10 11 12] [16 17 18 19 20]
[1] [3 4] [7 8 9] [13 14 15 16] [21 22 23 24 25]
------------------------------------------------------------------------
n 1 2 3 4 5
------------------------------------------------------------------------
a(n) 1 10 25 68 117
------------------------------------------------------------------------
(End)
|
|
MATHEMATICA
|
Array[If[EvenQ[#], #(#^2+1), (#-1/2)(#^2+1)]&, 50, 0] (* Harvey P. Dale, Sep 20 2013 *)
|
|
PROG
|
(Magma) [(n^2+1)*(4*n-1+(-1)^n)/4: n in [0..50]]; // G. C. Greubel, Mar 29 2024
(SageMath) [(n^2+1)*(2*n-(n%2))//2 for n in range(51)] # G. C. Greubel, Mar 29 2024
|
|
CROSSREFS
|
|
|
KEYWORD
|
nonn,easy
|
|
AUTHOR
|
|
|
STATUS
|
approved
|
|
|
|