Reminder: The OEIS is hiring a new managing editor, and the application deadline is January 26.
%I #23 Apr 15 2022 13:02:45
%S 0,1,1,0,0,-1,-1,-2,-2,-3,-3,-2,-2,-3,-3,-4,-4,-5,-5,-4,-4,-3,-3,-2,
%T -2,-3,-3,-2,-2,-3,-3,-4,-4,-5,-5,-4,-4,-3,-3,-2,-2,-1,-1,-2,-2,-1,-1,
%U 0,0,-1,-1,0,0,1,1,2,2,1,1,2,2,1,1,0,0,-1,-1,0,0,1,1,2
%N a(n) is the X-coordinate of the n-th point of the dragon curve. Sequence A332384 gives Y-coordinates.
%C To build the curve:
%C - start from the origin looking to the right,
%C - for k = 0, 1, ...:
%C - move forward to the next lattice point,
%C - if A014577(n) = 1 then turn 90 degrees to the left
%C otherwise turn 90 degrees to the right.
%H Rémy Sigrist, <a href="/A332383/b332383.txt">Table of n, a(n) for n = 0..8192</a>
%H Rémy Sigrist, <a href="/A332383/a332383.png">Colored representation of the first 2^18 points</a>
%H Eric Weisstein's World of Mathematics, <a href="http://mathworld.wolfram.com/DragonCurve.html">Dragon Curve</a>
%H Wikipedia, <a href="https://en.wikipedia.org/wiki/Dragon_curve">Dragon curve</a>
%H <a href="/index/Con#coordinates_2D_curves">Index entries for sequences related to coordinates of 2D curves</a>
%F For any k >= 0:
%F - a(2^(4*k)) = (-4)^k,
%F - a(2^(4*k+1)) = (-4)^k,
%F - a(2^(4*k+2)) = 0,
%F - a(2^(4*k+3)) = -2*(-4)^k.
%t Re[Join[{0}, Accumulate[Nest[Join[#, Reverse[I #]] &, {1}, 7]]]] (* _Vladimir Reshetnikov_, Apr 14 2022 *)
%o (PARI) A014577(n)=1/2*(1+(-1)^(1/2*((n+1)/2^valuation(n+1, 2)-1)))
%o { z=0; d=1; for (n=0, 71, print1 (real(z) ", "); z += d; d*=if (A014577(n), +I, -I)) }
%Y See A332251 for a similar sequence.
%Y Cf. A014577, A332384 (Y-coordinates).
%K sign,look,base
%O 0,8
%A _Rémy Sigrist_, Feb 10 2020