VOOZH about

URL: https://oeis.org/A389648

⇱ A389648 - OEIS


login
A389648
Y coordinate of point n while traversing the half plane by integer points in rectangular layers starting from n=1 at the origin.
4
0, 0, 1, 1, 1, 0, 0, 1, 2, 2, 2, 2, 2, 1, 0, 0, 1, 2, 3, 3, 3, 3, 3, 3, 3, 2, 1, 0, 0, 1, 2, 3, 4, 4, 4, 4, 4, 4, 4, 4, 4, 3, 2, 1, 0, 0, 1, 2, 3, 4, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 4, 3, 2, 1, 0, 0, 1, 2, 3, 4, 5, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 5, 4, 3, 2, 1, 0, 0, 1, 2, 3, 4, 5, 6, 7, 7, 7, 7, 7, 7, 7, 7
OFFSET
1,9
EXAMPLE
Path begins:
25--24--23--22--21--20--19 Y=3
| |
26 9--10--11--12--13 18 Y=2
| | | |
27 8 5---4---3 14 17 Y=1
| | | | | |
28 7---6 1---2 15--16 Y=0
----------------------------
X = -3 -2 -1 0 1 2 3
For n=8, the path has come to the point (-2, 1), which has the Y coordinate a(8) = 1.
PROG
(Python)
def traverse_upper_halfplane(n):
points = [(0, 0)]
arch = 1
sign = 1
while len(points) < n:
for y in range(arch+1):
points.append((sign*arch, y))
for x in range(arch-1, -arch-1, -1):
points.append((sign*x, arch))
for y in range(arch-1, -1, -1):
points.append((-sign*arch, y))
arch += 1
sign = - sign
return points[:n]
l = [y for (x, y) in traverse_upper_halfplane(106)]
print(l)
CROSSREFS
Cf. A389352, A389649 (X coordinate).
Cf. A274923 (whole plane), A002262 (first quadrant).
Sequence in context: A240713 A111409 A125088 * A226456 A343642 A268038
KEYWORD
nonn,easy
AUTHOR
Jens Ahlström, Oct 09 2025
STATUS
approved