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.

A137928 The even principal diagonal of a 2n X 2n square spiral.

This page as a plain text file.
%I A137928 #51 Jul 07 2022 06:44:15
%S A137928 2,4,10,16,26,36,50,64,82,100,122,144,170,196,226,256,290,324,362,400,
%T A137928 442,484,530,576,626,676,730,784,842,900,962,1024,1090,1156,1226,1296,
%U A137928 1370,1444,1522,1600,1682,1764,1850,1936,2026,2116,2210,2304,2402,2500,2602,2704,2810
%N A137928 The even principal diagonal of a 2n X 2n square spiral.
%C A137928 This is concerned with 2n X 2n square spirals of the form illustrated in the Example section.
%H A137928 <a href="/index/Rec#order_04">Index entries for linear recurrences with constant coefficients</a>, signature (2,0,-2,1).
%F A137928 a(n) = 2*n + 4*floor((n-1)^2/4) = 2*n + 4*A002620(n-1).
%F A137928 a(n) = A171218(n) - A171218(n-1). - _Reinhard Zumkeller_, Dec 05 2009
%F A137928 From _R. J. Mathar_, Jun 27 2011: (Start)
%F A137928 G.f.: 2*x*(1 + x^2) / ( (1 + x)*(1 - x)^3 ).
%F A137928 a(n) = 2*A000982(n). (End)
%F A137928 a(n+1) = (3 + 4*n + 2*n^2 + (-1)^n)/2 = A080335(n) + (-1)^n. - _Philippe Deléham_, Feb 17 2012
%F A137928 a(n) = 2 * ceiling(n^2/2). - _Wesley Ivan Hurt_, Jun 15 2013
%F A137928 a(n) = n^2 + (n mod 2). - _Bruno Berselli_, Oct 03 2017
%F A137928 Sum_{n>=1} 1/a(n) = Pi*tanh(Pi/2)/4 + Pi^2/24. - _Amiram Eldar_, Jul 07 2022
%e A137928 Example with n = 2:
%e A137928 .
%e A137928    7---8---9--10
%e A137928    |           |
%e A137928    6   1---2  11
%e A137928    |       |   |
%e A137928    5---4---3  12
%e A137928                |
%e A137928   16--15--14--13
%e A137928 .
%e A137928 a(1) = 2(1) + 4*floor((1-1)/4) = 2;
%e A137928 a(2) = 2(2) + 4*floor((2-1)/4) = 4.
%p A137928 A137928:=n->2*ceil(n^2/2): seq(A137928(n), n=1..100); # _Wesley Ivan Hurt_, Jul 25 2017
%t A137928 LinearRecurrence[{2,0,-2,1},{2,4,10,16},60] (* _Harvey P. Dale_, Aug 28 2017 *)
%o A137928 (Python) a = lambda n: 2*n + 4*floor((n-1)**2/4)
%o A137928 (PARI) a(n)=2*n+(n-1)^2\4*4 \\ _Charles R Greathouse IV_, May 21 2015
%Y A137928 Cf. A000982, A002061 (odd diagonal), A002620, A080335, A171218.
%K A137928 nonn,easy
%O A137928 1,1
%A A137928 _William A. Tedeschi_, Feb 29 2008