%I #28 May 13 2022 11:42:26
%S 0,1,7,18,33,54,80,110,146,186,231,282,337,397,462,532,607,687,772,
%T 861,956,1056,1160,1270,1384,1504,1628,1757,1891,2030,2174,2323,2477,
%U 2636,2800,2969,3142,3321,3504,3693,3886,4084,4288,4496,4709,4927,5150,5378,5611,5849,6091,6339
%N Numbers on the Spiral of Theodorus that come closer to the x-axis than their neighbors; a(0) = 0 and a(1) = 1.
%C The Spiral of Theodorus (a.k.a. Pythagorean spiral or Pythagoras's snail) results from constructing the square roots sqrt(2), sqrt(3), sqrt(4), ... as hypotenuse of the right triangle having the previous one as longer leg, and the shorter leg equal to 1, starting with the segment [0, 1] for sqrt(1). In the complex plane, this construction corresponds to a sequence z(n+1) = z(n) + i*z(n)/|z(n)|, starting with z(1) = 1 (and z(0) = 0 by convention).
%C This sequence lists those n for which the endpoint is closer to the x-axis than the preceding and next one (plus the two initial points 0 and 1 which are the only ones lying directly on the x-axis). In terms of the complex sequence z(n), this means the indices n such that abs(Im(z(n)) <= abs(Im(z(n +- 1))).
%C The two initial terms correspond to the points (0, 0) and (1, 0), which can be regarded as the start of the Pythagorean spiral, and are the only points exactly on the x-axis.
%C There is a smooth complex-valued function z: [0,oo) -> C, t |-> z(t), which interpolates the spiral in non-integer values. In terms of this function, a(n) = round(t(n)) where t(n) is the n-th zero of the imaginary part of z (if indexing starts with 0 for t(0) = 0, then t(1) = 1, and t(2) ~ 6.8 where z(6.8) = -1). (This function has a natural extension to the whole of R including also the negative real line, but we don't consider negative arguments here.)
%H Christian Mercat, <a href="https://www.geogebra.org/m/fGnDEWaR">Escargot de Pythagore: Spirale des racines carrées d'entiers</a>, GeoGebra.org, Dec. 12, 2015
%H Wikipedia, <a href="https://en.wikipedia.org/wiki/Spiral_of_Theodorus">Spiral of Theodorus</a>, as of March 14, 2022
%F a(2n+1) = A072895(n) or A072895(n)+1, for all n > 0.
%o (PARI) z=!t=y=0; [n | n<-[0..10^4], ![t < t=y, y > y=abs(imag(z))]*z*=1+I/abs(z)]
%Y Cf. A072895, A137515, A105459 (Hlawka's "snail constant").
%K nonn
%O 0,3
%A _M. F. Hasler_, Mar 31 2022