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.

A355759 Sums of the first ceiling((n+1)/2) entries on the diagonals of a square spiral with a starting value of 1 in the center, where the diagonal and the antidiagonal are used alternately.

This page as a plain text file.
%I A355759 #53 Nov 21 2022 10:01:07
%S A355759 1,4,6,11,15,24,32,45,57,76,94,119,143,176,208,249,289,340,390,451,
%T A355759 511,584,656,741,825,924,1022,1135,1247,1376,1504,1649,1793,1956,2118,
%U A355759 2299,2479,2680,2880,3101,3321,3564,3806,4071,4335,4624,4912,5225,5537,5876,6214,6579,6943
%N A355759 Sums of the first ceiling((n+1)/2) entries on the diagonals of a square spiral with a starting value of 1 in the center, where the diagonal and the antidiagonal are used alternately.
%H A355759 Karl-Heinz Hofmann, <a href="/A355759/b355759.txt">Table of n, a(n) for n = 1..10000</a>
%H A355759 Karl-Heinz Hofmann, <a href="/A355759/a355759_1.pdf">Examples of a(1..18)</a>
%H A355759 Project Euler, <a href="https://projecteuler.net/problem=28">Problem 28. Number spiral diagonals</a>
%H A355759 <a href="/index/Rec#order_08">Index entries for linear recurrences with constant coefficients</a>, signature (2,0,-2,2,-2,0,2,-1).
%F A355759 G.f.: -(x^7 - 2*x^6 + x^4 - x^3 + 2*x^2 - 2*x-1)/((x - 1)^4 * (x + 1)^2 * (x^2 +1)).
%F A355759 a(n) = (24 + 20*n + 6*n^2 + n^3) / 24  for n even.
%F A355759 a(n) = (12 + 17*n + 6*n^2 + n^3) / 24  for n odd and n (mod 4) == 3.
%F A355759 a(n) =      (17*n + 6*n^2 + n^3) / 24  for n odd and n (mod 4) == 1.
%F A355759 a(2*n) = A006527(n+1).
%F A355759 a(2*n-1) = A208995(n) - 1.
%F A355759 E.g.f.: ((30 + 45*x + 12*x^2 + x^3)*cosh(x) + (51 + 42*x + 12*x^2 + x^3)*sinh(x) - 6*cos(x))/24. - _Stefano Spezia_, Aug 19 2022
%e A355759 See the PDF in links.
%t A355759 CoefficientList[Series[-(x^7 - 2*x^6 + x^4 - x^3 + 2*x^2 - 2*x - 1)/((x - 1)^4*(x + 1)^2*(x^2 + 1)), {x, 0, 50}], x] (* _Amiram Eldar_, Aug 19 2022 *)
%o A355759 (Python)
%o A355759 def A355759(n):  # polynomial way.
%o A355759     if   n % 2 == 0: return((24 + 20*n + 6*n**2 + n**3)//24)
%o A355759     elif n % 4 == 3: return((12 + 17*n + 6*n**2 + n**3)//24)
%o A355759     elif n % 4 == 1: return((     17*n + 6*n**2 + n**3)//24)
%o A355759 (PARI) a(n) = (n^2 + 6*n + if(n%2,17,20))*n \ 24 + (n%4!=1); \\ _Kevin Ryde_, Aug 19 2022
%Y A355759 Cf. A200975, A106607, A114254.
%Y A355759 Cf. A006527 and A208995 (bisections, see formulas).
%K A355759 nonn,easy
%O A355759 1,2
%A A355759 _Karl-Heinz Hofmann_, Aug 14 2022