The OEIS Foundation is supported by donations from users of the OEIS and by a grant from the Simons Foundation.

 Hints (Greetings from The On-Line Encyclopedia of Integer Sequences!)
 A059924 Write the numbers from 1 to n^2 in a spiraling square; a(n) is the total of the sums of the two diagonals. 1
 0, 2, 10, 34, 80, 158, 274, 438, 656, 938, 1290, 1722, 2240, 2854, 3570, 4398, 5344, 6418, 7626, 8978, 10480, 12142, 13970, 15974, 18160, 20538, 23114, 25898, 28896, 32118, 35570, 39262, 43200, 47394, 51850, 56578, 61584, 66878, 72466, 78358 (list; graph; refs; listen; history; text; internal format)
 OFFSET 0,2 COMMENTS If n is odd, n^2 is counted twice. LINKS Harry J. Smith, Table of n, a(n) for n = 0..1000 Index entries for linear recurrences with constant coefficients, signature (3,-2,-2,3,-1). FORMULA a(n) = 3a(n-1)-2a(n-2)-2a(n-3)+3a(n-4)-a(n-5), a(0) = 0, a(1) = 2, a(2) = 10, a(3) = 34, a(4) = 80. a(n) = (16*n^3 - 6*n^2 + 8*n + 3 - 3*(-1)^n)/12. - Frank Ellermann, Mar 16 2002 O.g.f.: (2*x+4*x^2+8*x^3+2*x^4)/(1-3*x+2*x^2+2*x^3-3*x^4+x^5)=(2*x+4*x^2+8*x^3+2*x^4)/((1-x)^4*(1+x)). - Eric Werley, Jun 30 2011 EXAMPLE Write the numbers from 1 to 16 like this: .    1---2---3---4                |   12--13--14   5    |       |   |   11  16--15   6    |           |   10---9---8---7 . The two diagonals add to 36 and 44, so a(4) = 36 + 44 = 80. MATHEMATICA LinearRecurrence[{3, -2, -2, 3, -1}, {0, 2, 10, 34, 80}, 40] (* Harvey P. Dale, Mar 23 2012 *) PROG (PARI) { for (n=0, 1000, write("b059924.txt", n, " ", floor((16*n^3 - 6*n^2 + 8*n + 3 - 3*(-1^n))/12)); ) } \\ Harry J. Smith, Jun 30 2009 CROSSREFS Sequence in context: A043004 A316172 A108100 * A304159 A211905 A022498 Adjacent sequences:  A059921 A059922 A059923 * A059925 A059926 A059927 KEYWORD easy,nice,nonn AUTHOR Fabian Rothelius, Feb 10 2001 EXTENSIONS Corrected and extended by Eric Werley, Jun 30 2011 STATUS approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recent
The OEIS Community | Maintained by The OEIS Foundation Inc.

Last modified June 22 04:06 EDT 2021. Contains 345367 sequences. (Running on oeis4.)