cp's OEIS Frontend

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.

A114254 Sum of all terms on the two principal diagonals of a 2n+1 X 2n+1 square spiral.

This page as a plain text file.
%I A114254 #105 Sep 16 2023 17:42:49
%S A114254 1,25,101,261,537,961,1565,2381,3441,4777,6421,8405,10761,13521,16717,
%T A114254 20381,24545,29241,34501,40357,46841,53985,61821,70381,79697,89801,
%U A114254 100725,112501,125161,138737,153261,168765,185281,202841,221477,241221
%N A114254 Sum of all terms on the two principal diagonals of a 2n+1 X 2n+1 square spiral.
%H A114254 Michael De Vlieger, <a href="/A114254/b114254.txt">Table of n, a(n) for n = 0..10000</a>
%H A114254 Project Euler, <a href="https://projecteuler.net/problem=28">Problem 28. Number Spiral Diagonals</a>
%H A114254 <a href="/index/Rec#order_04">Index entries for linear recurrences with constant coefficients</a>, signature (4,-6,4,-1).
%F A114254 O.g.f.: 3/(-1+x) + 16/(-1+x)^2 + 44/(-1+x)^3 + 32/(-1+x)^4 = (1 + 21*x + 7*x^2 + 3*x^3)/(-1+x)^4. - _R. J. Mathar_, Feb 10 2008
%F A114254 a(n) = 1 + 10*n^2 + (16*n^3 + 26*n)/3. [Corrected by _Arie Groeneveld_, Aug 17 2008]
%e A114254 For n = 1, the 3 X 3 spiral is
%e A114254 .
%e A114254        7---8---9
%e A114254        |
%e A114254        6   1---2
%e A114254        |       |
%e A114254        5---4---3
%e A114254 .
%e A114254 so a(1) = 7 + 9 + 1 + 5 + 3 = 25.
%e A114254 .
%e A114254 For n = 2, the 5 X 5 spiral is
%e A114254 .
%e A114254   21--22--23--24--25
%e A114254    |
%e A114254   20   7---8---9--10
%e A114254    |   |           |
%e A114254   19   6   1---2  11
%e A114254    |   |       |   |
%e A114254   18   5---4---3  12
%e A114254    |               |
%e A114254   17--16--15--14--13
%e A114254 .
%e A114254 so a(2) = 21 + 25 + 7 + 9 + 1 + 5 + 3 + 17 + 13 = 101.
%t A114254 Array[1 + 10 #^2 + (16 #^3 + 26 #)/3 &, 36, 0] (* _Michael De Vlieger_, Mar 01 2018 *)
%o A114254 (PARI) a(n) = 1 + 10*n^2 + (16*n^3 + 26*n)/3; \\ _Joerg Arndt_, Mar 01 2018
%Y A114254 Cf. A016754, A054569, A053755, A054554 for diagonals from origin.
%Y A114254 Cf. A325958 (first differences).
%K A114254 easy,nonn
%O A114254 0,2
%A A114254 _William A. Tedeschi_, Feb 06 2008, Mar 01 2008