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.
%I A317186 #88 Mar 21 2025 08:29:34 %S A317186 1,2,6,11,19,28,40,53,69,86,106,127,151,176,204,233,265,298,334,371, %T A317186 411,452,496,541,589,638,690,743,799,856,916,977,1041,1106,1174,1243, %U A317186 1315,1388,1464,1541,1621,1702,1786,1871,1959,2048,2140,2233,2329,2426 %N A317186 One of many square spiral sequences: a(n) = n^2 + n - floor((n-1)/2). %C A317186 Draw a square spiral on a piece of graph paper, and label the cells starting at the center with the positive (resp. nonnegative) numbers. This produces two versions of the labeled square spiral, shown in the Example section below. %C A317186 The spiral may proceed clockwise or counterclockwise, and the first arm of the spiral may be along any of the four axes, so there are eight versions of each spiral. However, this has no effect on the resulting sequences, and it is enough to consider just two versions of the square spiral (starting at 1 or starting at 0). %C A317186 The present sequence is obtained by reading alternate entries on the X-axis (say) of the square spiral started at 1. %C A317186 The cross-references section lists many sequences that can be read directly off the two spirals. Many other sequences can be obtained from them by using them to extract subsequences from other important sequences. For example, the subsequence of primes indexed by the present sequence gives A317187. %C A317186 a(n) is also the number of free polyominoes with n + 4 cells whose difference between length and width is n. In this comment the length is the longer of the two dimensions and the width is the shorter of the two dimensions (see the examples of polyominoes). Hence this is also the diagonal 4 of A379625. - _Omar E. Pol_, Jan 24 2025 %C A317186 From _John Mason_, Feb 19 2025: (Start) %C A317186 The sequence enumerates polyominoes of width 2 having precisely 2 horizontal bars. By classifying such polyominoes according to the following templates, it is possible to define a formula that reduces to the one below: %C A317186 . %C A317186 OO O O %C A317186 O OO OO %C A317186 O O O %C A317186 O O OO %C A317186 OO OO O %C A317186 . %C A317186 (End) %H A317186 <a href="/index/Rec#order_04">Index entries for linear recurrences with constant coefficients</a>, signature (2,0,-2,1). %H A317186 <a href="/index/Pol#polyominoes">Index entries for sequences related to polyominoes</a>. %F A317186 From _Daniel Forgues_, Aug 01 2018: (Start) %F A317186 a(n) = (1/4) * (4 * n^2 + 2 * n + (-1)^n + 3), n >= 0. %F A317186 a(0) = 1; a(n) = - a(n-1) + 2 * n^2 - n + 2, n >= 1. %F A317186 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. %F A317186 G.f.: (- x^3 - 2 * x^2 - 1) / ((x - 1)^3 * (x + 1)). (End) %F A317186 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 %F A317186 a(n)+a(n+1)=A033816(n). - _R. J. Mathar_, Mar 21 2025 %F A317186 a(n)-a(n-1) = A042948(n), n>=1. - _R. J. Mathar_, Mar 21 2025 %e A317186 The square spiral when started with 1 begins: %e A317186 . %e A317186 100--99--98--97--96--95--94--93--92--91 %e A317186 | %e A317186 65--64--63--62--61--60--59--58--57 90 %e A317186 | | | %e A317186 66 37--36--35--34--33--32--31 56 89 %e A317186 | | | | | %e A317186 67 38 17--16--15--14--13 30 55 88 %e A317186 | | | | | | | %e A317186 68 39 18 5---4---3 12 29 54 87 %e A317186 | | | | | | | | | %e A317186 69 40 19 6 1---2 11 28 53 86 %e A317186 | | | | | | | | %e A317186 70 41 20 7---8---9--10 27 52 85 %e A317186 | | | | | | %e A317186 71 42 21--22--23--24--25--26 51 84 %e A317186 | | | | %e A317186 72 43--44--45--46--47--48--49--50 83 %e A317186 | | %e A317186 73--74--75--76--77--78--79--80--81--82 %e A317186 . %e A317186 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: %e A317186 . %e A317186 99 64--65--66--67--68--69--70--71--72 %e A317186 | | | %e A317186 98 63 36--37--38--39--40--41--42 73 %e A317186 | | | | | %e A317186 97 62 35 16--17--18--19--20 43 74 %e A317186 | | | | | | | %e A317186 96 61 34 15 4---5---6 21 44 75 %e A317186 | | | | | | | | | %e A317186 95 60 33 14 3 0 7 22 45 76 %e A317186 | | | | | | | | | | %e A317186 94 59 32 13 2---1 8 23 46 77 %e A317186 | | | | | | | | %e A317186 93 58 31 12--11--10---9 24 47 78 %e A317186 | | | | | | %e A317186 92 57 30--29--28--27--26--25 48 79 %e A317186 | | | | %e A317186 91 56--55--54--53--52--51--50--49 80 %e A317186 | | %e A317186 90--89--88--87--86--85--84--83--82--81 %e A317186 . %e A317186 From _Omar E. Pol_, Jan 24 2025: (Start) %e A317186 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. %e A317186 _ _ %e A317186 |_|_| %e A317186 |_|_| %e A317186 . %e A317186 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. %e A317186 _ _ _ _ %e A317186 |_|_| |_|_| %e A317186 |_|_| |_|_ %e A317186 |_| |_|_| %e A317186 . %e A317186 (End) %t A317186 a[n_] := n^2 + n - Floor[(n - 1)/2]; Array[a, 50, 0] (* _Robert G. Wilson v_, Aug 01 2018 *) %t A317186 LinearRecurrence[{2, 0, -2 , 1},{1, 2, 6, 11},50] (* or *) %t A317186 CoefficientList[Series[(- x^3 - 2 * x^2 - 1) / ((x - 1)^3 * (x + 1)), {x, 0, 50}], x] (* _Stefano Spezia_, Sep 02 2018 *) %Y A317186 Sequences on the four axes of the square spiral: Starting at 0: A001107, A033991, A007742, A033954; starting at 1: A054552, A054556, A054567, A033951. %Y A317186 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. %Y A317186 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. %Y A317186 Filling in these two squares spirals with greedy algorithm: A274640, A274641. %Y A317186 Cf. also A317187. %Y A317186 Cf. A000105, A379625. %K A317186 nonn,easy %O A317186 0,2 %A A317186 _N. J. A. Sloane_, Jul 27 2018