This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.
%I A137931 #8 May 06 2019 05:22:15 %S A137931 0,10,56,170,384,730,1240,1946,2880,4074,5560,7370,9536,12090,15064, %T A137931 18490,22400,26826,31800,37354,43520,50330,57816,66010,74944,84650, %U A137931 95160,106506,118720,131834,145880,160890,176896,193930,212024,231210,251520,272986,295640 %N A137931 Sum of the principal diagonals of a 2n X 2n square spiral. %C A137931 This is concerned with 2n X 2n square spirals of the form illustrated in the Example section. %H A137931 <a href="/index/Rec#order_04">Index entries for linear recurrences with constant coefficients</a>, signature (4,-6,4,-1). %F A137931 a(n) = -1 + n + Sum_{k=0..2n} (2k^2 - k + 1) = n -1 +(2*n+1)*(8*n^2-n+3)/3. %F A137931 a(n) = 2*n^2 + 2*n + (16*n^3 + 2*n)/3 = 2*n*(8*n^2+3*n+4)/3. %F A137931 G.f.: 2*x*(3*x+5)*(x+1)/(x-1)^4. - Maksym Voznyy (voznyy(AT)mail.ru), Jul 27 2009 %e A137931 Example with n = 2: %e A137931 . %e A137931 7---8---9--10 %e A137931 | | %e A137931 6 1---2 11 %e A137931 | | | %e A137931 5---4---3 12 %e A137931 | %e A137931 16--15--14--13 %e A137931 . %e A137931 a(0) = 2(0)^2 + 2(0) + (16(0)^3 + 2(0))/3 = 0; %e A137931 a(2) = 2(2)^2 + 2(2) + (16(2)^3 + 2(2))/3 = 56. %o A137931 (Python) f = lambda n: -1 + n + sum(2*k**2 - k + 1 for k in range(0,2*n+1)) %o A137931 (Python) a = lambda n: 2*n**2 + 2*n + (16*n**3 + 2*n)/3 %Y A137931 Cf. A137928, A002061. A bisection of A137930. %K A137931 nonn,easy %O A137931 0,2 %A A137931 _William A. Tedeschi_, Feb 29 2008