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.

A329972 Y-coordinate of a point moving in a triangular spiral.

This page as a plain text file.
%I A329972 #30 Sep 19 2020 02:53:10
%S A329972 0,0,1,0,-1,-1,-1,-1,-1,-1,0,1,2,1,0,-1,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,
%T A329972 -1,0,1,2,3,2,1,0,-1,-2,-3,-3,-3,-3,-3,-3,-3,-3,-3,-3,-3,-3,-3,-3,-2,
%U A329972 -1,0,1,2,3,4,3,2,1,0,-1,-2,-3,-4
%N A329972 Y-coordinate of a point moving in a triangular spiral.
%C A329972 A329116 gives x-coordinates for a point moving in counterclockwise triangular spiral.
%H A329972 Rémy Sigrist, <a href="/A329972/b329972.txt">Table of n, a(n) for n = 0..10000</a>
%H A329972 <a href="/index/Con#coordinates_2D_curves">Index entries for sequences related to coordinates of 2D curves</a>
%F A329972 a(n) = floor(min(s*max(((0, 2*s) mod 2) - 2), (-2*s*s) mod (-1)) + ceiling(-s/2)) where s=sqrt(n).
%e A329972     y
%e A329972      |
%e A329972    4 |                         56
%e A329972      |                           \
%e A329972      |                            \
%e A329972      |                             \
%e A329972    3 |                         30  55
%e A329972      |                         / \   \
%e A329972      |                        /   \   \
%e A329972      |                       /     \   \
%e A329972    2 |                     31  12  29  54
%e A329972      |                     /   / \   \   \
%e A329972      |                    /   /   \   \   \
%e A329972      |                   /   /     \   \   \
%e A329972    1 |                 32  13   2  11  28  53
%e A329972      |                 /   /   / \   \   \   \
%e A329972      |                /   /   /   \   \   \   \
%e A329972      |               /   /   /     \   \   \   \
%e A329972    0 |             33  14   3   0---1  10  27  52
%e A329972      |             /   /   /             \   \   \
%e A329972      |            /   /   /               \   \   \
%e A329972      |           /   /   /                 \   \   \
%e A329972   -1 |         34  15   4---5---6---7---8---9  26  51
%e A329972      |         /   /                             \   \
%e A329972      |        /   /                               \   \
%e A329972      |       /   /                                 \   \
%e A329972   -2 |     35  16--17--18--19--20--21--22--23--24--25  50
%e A329972      |     /                                             \
%e A329972      |    /                                               \
%e A329972      |   /                                                 \
%e A329972   -3 | 36--37--38--39--40--41--42--43--44--45--46--47--48--49
%e A329972      |
%e A329972      +--------------------------------------------------------
%e A329972    x:  -6  -5  -4  -3  -2  -1   0   1   2   3   4   5   6   7
%t A329972 a[n_] := Table[Floor[Min[#*Max[0, 2*Mod[#, 2] - 2], -2*#*Mod[#, -1]] + Ceiling[-#/2]] &[Sqrt@ k], {k, 0, n}]; a[64]
%Y A329972 Cf. A268038, A274923.
%K A329972 sign,look
%O A329972 0,13
%A A329972 _Mikk Heidemaa_, Nov 26 2019