login
A332383
a(n) is the X-coordinate of the n-th point of the dragon curve. Sequence A332384 gives Y-coordinates.
6
0, 1, 1, 0, 0, -1, -1, -2, -2, -3, -3, -2, -2, -3, -3, -4, -4, -5, -5, -4, -4, -3, -3, -2, -2, -3, -3, -2, -2, -3, -3, -4, -4, -5, -5, -4, -4, -3, -3, -2, -2, -1, -1, -2, -2, -1, -1, 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
OFFSET
0,8
COMMENTS
To build the curve:
- start from the origin looking to the right,
- for k = 0, 1, ...:
- move forward to the next lattice point,
- if A014577(n) = 1 then turn 90 degrees to the left
otherwise turn 90 degrees to the right.
FORMULA
For any k >= 0:
- a(2^(4*k)) = (-4)^k,
- a(2^(4*k+1)) = (-4)^k,
- a(2^(4*k+2)) = 0,
- a(2^(4*k+3)) = -2*(-4)^k.
MATHEMATICA
Re[Join[{0}, Accumulate[Nest[Join[#, Reverse[I #]] &, {1}, 7]]]] (* Vladimir Reshetnikov, Apr 14 2022 *)
PROG
(PARI) A014577(n)=1/2*(1+(-1)^(1/2*((n+1)/2^valuation(n+1, 2)-1)))
{ z=0; d=1; for (n=0, 71, print1 (real(z) ", "); z += d; d*=if (A014577(n), +I, -I)) }
CROSSREFS
See A332251 for a similar sequence.
Cf. A014577, A332384 (Y-coordinates).
Sequence in context: A076902 A287271 A290884 * A340327 A332249 A049113
KEYWORD
sign,look,base
AUTHOR
Rémy Sigrist, Feb 10 2020
STATUS
approved