A317186 One of many square spiral sequences: a(n) = n^2 + n - floor((n-1)/2).
1, 2, 6, 11, 19, 28, 40, 53, 69, 86, 106, 127, 151, 176, 204, 233, 265, 298, 334, 371, 411, 452, 496, 541, 589, 638, 690, 743, 799, 856, 916, 977, 1041, 1106, 1174, 1243, 1315, 1388, 1464, 1541, 1621, 1702, 1786, 1871, 1959, 2048, 2140, 2233, 2329, 2426
Offset: 0
Examples
The square spiral when started with 1 begins: . 100--99--98--97--96--95--94--93--92--91 | 65--64--63--62--61--60--59--58--57 90 | | | 66 37--36--35--34--33--32--31 56 89 | | | | | 67 38 17--16--15--14--13 30 55 88 | | | | | | | 68 39 18 5---4---3 12 29 54 87 | | | | | | | | | 69 40 19 6 1---2 11 28 53 86 | | | | | | | | 70 41 20 7---8---9--10 27 52 85 | | | | | | 71 42 21--22--23--24--25--26 51 84 | | | | 72 43--44--45--46--47--48--49--50 83 | | 73--74--75--76--77--78--79--80--81--82 . For the square spiral when started with 0, subtract 1 from each entry. In the following diagram this spiral has been reflected and rotated, but of course that makes no difference to the sequences: . 99 64--65--66--67--68--69--70--71--72 | | | 98 63 36--37--38--39--40--41--42 73 | | | | | 97 62 35 16--17--18--19--20 43 74 | | | | | | | 96 61 34 15 4---5---6 21 44 75 | | | | | | | | | 95 60 33 14 3 0 7 22 45 76 | | | | | | | | | | 94 59 32 13 2---1 8 23 46 77 | | | | | | | | 93 58 31 12--11--10---9 24 47 78 | | | | | | 92 57 30--29--28--27--26--25 48 79 | | | | 91 56--55--54--53--52--51--50--49 80 | | 90--89--88--87--86--85--84--83--82--81 . From _Omar E. Pol_, Jan 24 2025: (Start) For n = 0 there is only one free polyomino with 0 + 4 = 4 cells whose difference between length and width is 0 as shown below, so a(0) = 1. _ _ |_|_| |_|_| . For n = 1 there are two free polyominoes with 1 + 4 = 5 cells whose difference between length and width is 1 as shown below, so a(1) = 2. _ _ _ _ |_|_| |_|_| |_|_| |_|_ |_| |_|_| . (End)
Links
Crossrefs
Sequences on the four axes of the square spiral: Starting at 0: A001107, A033991, A007742, A033954; starting at 1: A054552, A054556, A054567, A033951.
Sequences on the four diagonals of the square spiral: Starting at 0: A002939 = 2*A000384, A016742 = 4*A000290, A002943 = 2*A014105, A033996 = 8*A000217; starting at 1: A054554, A053755, A054569, A016754.
Sequences obtained by reading alternate terms on the X and Y axes and the two main diagonals of the square spiral: Starting at 0: A035608, A156859, A002378 = 2*A000217, A137932 = 4*A002620; starting at 1: A317186, A267682, A002061, A080335.
Cf. also A317187.
Programs
-
Mathematica
a[n_] := n^2 + n - Floor[(n - 1)/2]; Array[a, 50, 0] (* Robert G. Wilson v, Aug 01 2018 *) LinearRecurrence[{2, 0, -2 , 1},{1, 2, 6, 11},50] (* or *) CoefficientList[Series[(- x^3 - 2 * x^2 - 1) / ((x - 1)^3 * (x + 1)), {x, 0, 50}], x] (* Stefano Spezia, Sep 02 2018 *)
Formula
From Daniel Forgues, Aug 01 2018: (Start)
a(n) = (1/4) * (4 * n^2 + 2 * n + (-1)^n + 3), n >= 0.
a(0) = 1; a(n) = - a(n-1) + 2 * n^2 - n + 2, n >= 1.
a(0) = 1; a(1) = 2; a(2) = 6; a(3) = 11; a(n) = 2 * a(n-1) - 2 * a(n-3) + a(n-4), n >= 4.
G.f.: (- x^3 - 2 * x^2 - 1) / ((x - 1)^3 * (x + 1)). (End)
E.g.f.: ((2 + 3*x + 2*x^2)*cosh(x) + (1 + 3*x + 2*x^2)*sinh(x))/2. - Stefano Spezia, Apr 24 2024
a(n)+a(n+1)=A033816(n). - R. J. Mathar, Mar 21 2025
a(n)-a(n-1) = A042948(n), n>=1. - R. J. Mathar, Mar 21 2025
Comments