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
G. C. Greubel, Table of n, a(n) for n = 0..1000
Index entries for linear recurrences with constant coefficients, signature (1,3,-3,-3,3,1,-1).
FORMULA
From R. J. Mathar, Oct 19 2010: (Start)
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)
a(n) = (n^2+1)*(4*n-1+(-1)^n)/4. - Wesley Ivan Hurt, May 15 2021
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
From Wesley Ivan Hurt, May 15 2021: (Start)
[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
N. J. A. Sloane, Jun 12 2002
STATUS
approved