The OEIS Foundation is supported by donations from users of the OEIS and by a grant from the Simons Foundation.

 Hints (Greetings from The On-Line Encyclopedia of Integer Sequences!)
 A329972 Y-coordinate of a point moving in a triangular spiral. 4
 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, -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, -1, 0, 1, 2, 3, 4, 3, 2, 1, 0, -1, -2, -3, -4 (list; graph; refs; listen; history; text; internal format)
 OFFSET 0,13 COMMENTS A329116 gives x-coordinates for a point moving in counterclockwise triangular spiral. LINKS Rémy Sigrist, Table of n, a(n) for n = 0..10000 FORMULA a(n) = floor(min(s*max(((0, 2*s) mod 2) - 2), (-2*s*s) mod (-1)) + ceiling(-s/2)) where s=sqrt(n). EXAMPLE y      |    4 |                         56      |                           \      |                            \      |                             \    3 |                         30  55      |                         / \   \      |                        /   \   \      |                       /     \   \    2 |                     31  12  29  54      |                     /   / \   \   \      |                    /   /   \   \   \      |                   /   /     \   \   \    1 |                 32  13   2  11  28  53      |                 /   /   / \   \   \   \      |                /   /   /   \   \   \   \      |               /   /   /     \   \   \   \    0 |             33  14   3   0---1  10  27  52      |             /   /   /             \   \   \      |            /   /   /               \   \   \      |           /   /   /                 \   \   \   -1 |         34  15   4---5---6---7---8---9  26  51      |         /   /                             \   \      |        /   /                               \   \      |       /   /                                 \   \   -2 |     35  16--17--18--19--20--21--22--23--24--25  50      |     /                                             \      |    /                                               \      |   /                                                 \   -3 | 36--37--38--39--40--41--42--43--44--45--46--47--48--49      |      +--------------------------------------------------------    x:  -6  -5  -4  -3  -2  -1   0   1   2   3   4   5   6   7 MATHEMATICA a[n_] := Table[Floor[Min[#*Max[0, 2*Mod[#, 2] - 2], -2*#*Mod[#, -1]] + Ceiling[-#/2]] &[Sqrt@ k], {k, 0, n}]; a[64] CROSSREFS Cf. A268038, A274923. Sequence in context: A030363 A236460 A029388 * A321005 A055254 A035670 Adjacent sequences:  A329969 A329970 A329971 * A329973 A329974 A329975 KEYWORD sign,look AUTHOR Mikk Heidemaa, Nov 26 2019 STATUS approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recent
The OEIS Community | Maintained by The OEIS Foundation Inc.

Last modified September 23 20:42 EDT 2021. Contains 347617 sequences. (Running on oeis4.)