A137932 Terms in an n X n spiral that do not lie on its principal diagonals.
0, 0, 0, 4, 8, 16, 24, 36, 48, 64, 80, 100, 120, 144, 168, 196, 224, 256, 288, 324, 360, 400, 440, 484, 528, 576, 624, 676, 728, 784, 840, 900, 960, 1024, 1088, 1156, 1224, 1296, 1368, 1444, 1520, 1600, 1680, 1764, 1848, 1936, 2024, 2116, 2208, 2304, 2400, 2500, 2600, 2704, 2808
Offset: 0
Examples
a(0) = 0^2 - (2(0) - mod(0,2)) = 0. a(3) = 3^2 - (2(3) - mod(3,2)) = 4.
Links
- Enrique Pérez Herrero, Table of n, a(n) for n = 0..5000
- Kival Ngaokrajang, Illustration of initial terms.
- Eric Weisstein's World of Mathematics, Complete Bipartite Graph.
- Eric Weisstein's World of Mathematics, Graph Circumference.
- Eric Weisstein's World of Mathematics, Graph Crossing Number.
- Eric Weisstein's World of Mathematics, Grid Graph.
- Index entries for linear recurrences with constant coefficients, signature (2,0,-2,1).
Crossrefs
Cf. A042948.
Sequences on the four axes of the square spiral: Starting at 0: A001107, A033991, A007742, A033954; starting at 1: A054552, A054556, A054567, A033951.
Programs
-
Maple
A137932:=n->2*floor((n-1)^2/2); seq(A137932(n), n=0..50); # Wesley Ivan Hurt, Apr 19 2014
-
Mathematica
Table[2 Floor[(n - 1)^2/2], {n, 0, 20}] (* Enrique Pérez Herrero, Jul 04 2012 *) 2 Floor[(Range[20] - 1)^2/2] (* Eric W. Weisstein, Sep 11 2018 *) Table[n^2 - 2 n + (1 - (-1)^n)/2, {n, 20}] (* Eric W. Weisstein, Sep 11 2018 *) LinearRecurrence[{2, 0, -2, 1}, {0, 0, 4, 8}, 20] (* Eric W. Weisstein, Sep 11 2018 *) CoefficientList[Series[-((4 x^2)/((-1 + x)^3 (1 + x))), {x, 0, 20}], x] (* Eric W. Weisstein, Sep 11 2018 *)
-
PARI
A137932(n)={ return(n^2 - (2*n-n%2))} ; print(vector(30,n,A137932(n-1))); /* R. J. Mathar, May 12 2014 */
-
Python
a = lambda n: n**2 - (2*n - (n%2))
Formula
a(n) = n^2 - (2*n - mod(n,2)) = n^2 - A042948(n).
a(n) = 2*A007590(n-1). - Enrique Pérez Herrero, Jul 04 2012
G.f.: -4*x^3 / ( (1+x)*(x-1)^3 ). a(n) = 4*A002620(n-1). - R. J. Mathar, Jul 06 2012
From Bob Selcoe, Feb 12 2015: (Start)
a(n) = (n-1)^2 when n is odd; a(n) = (n-1)^2 - 1 when n is even.
From Amiram Eldar, Mar 20 2022: (Start)
Sum_{n>=3} 1/a(n) = Pi^2/24 + 1/4.
Sum_{n>=3} (-1)^(n+1)/a(n) = Pi^2/24 - 1/4. (End)
E.g.f.: x*(x - 1)*cosh(x) + (x^2 - x + 1)*sinh(x). - Stefano Spezia, Oct 17 2022
Comments