Fiddling around with some recursion and the dragon curve and what should pop out but this exact sequence.
https://oeis.org/A072339
While it wasn't at all obvious to me that it would match a sequence like this, it is easy to demonstrate the connection. Take the odd numbers and use them as right turns and the even numbers as left turns.
Shame I don't have access to Knuth's work to see if the connection is described there.
@Unprovable
=> More informations about this toot | More toots from geoffl@mastodon.me.uk
Going from the dragon curve to that sequence is slightly more tricky but only involves counting the number of times a turn is flipped left/right or right/left at each iteration.
=> More informations about this toot | More toots from geoffl@mastodon.me.uk
Maybe he didn't. :)
https://youtu.be/v678Em6qyzk
=> More informations about this toot | More toots from geoffl@mastodon.me.uk
[#]bbcmicrobot 🚀MO.0:GC.3,1
P."Any number n can be written in the form n = 2^k1 - 2^k2 + 2^k3 - ... + 2^kx"'"where the signs alternate and k1 > k2 > k3 > ... >kx >= 0."'"E.G. a(6)=2 since 6=2^3-2^1. Sequence gives the minimal value of x."
V.28,59,12,79,4
DIMX(3),Y(3):D=0
X(0)=4:X(2)=-4:Y(1)=4:Y(3)=-4
MOVE359,719
REP.L=1+L
PL.1,X(D),Y(D)
N=L:T=N:C=0:R=1:Z=1
REP.T=T/2:C=C+1:U.T<=1
M=2^(C-1):E=2^C
REP.
IFN>M ANDN<E R=R+1:Z=2EORZ:N=E-N
E=E/2:M=M/2:U.M<2
D=(D+Z)MOD4
P.';"a("L") = "R;
U.0
=> More informations about this toot | More toots from geoffl@mastodon.me.uk
I ran @geoffl's program and got this.
Source: https://bbcmic.ro/?t=beHPj #bbcbasic
=> More informations about this toot | More toots from bbcmicrobot@mastodon.me.uk
[#]bbcmicrobot 🎬MO.0:GC.3,1
P."Any number n can be written in the form n = 2^k1 - 2^k2 + 2^k3 - ... + 2^kx"'"where the signs alternate and k1 > k2 > k3 > ... >kx >= 0."'"E.G. a(6)=2 since 6=2^3-2^1. Sequence gives the minimal value of x."
V.28,59,12,79,4
DIMX(3),Y(3):D=0
X(0)=4:X(2)=-4:Y(1)=4:Y(3)=-4
MOVE359,719
REP.L=1+L
PL.1,X(D),Y(D)
N=L:T=N:C=0:R=1:Z=1
REP.T=T/2:C=C+1:U.T<=1
M=2^(C-1):E=2^C
REP.
IFN>M ANDN<E R=R+1:Z=2EORZ:N=E-N
E=E/2:M=M/2:U.M<2
D=(D+Z)MOD4
P.';"a("L") = "R;
U.0
=> More informations about this toot | More toots from geoffl@mastodon.me.uk
I ran @geoffl's program and got this.
Source: https://bbcmic.ro/?t=beHRB #bbcbasic
=> More informations about this toot | More toots from bbcmicrobot@mastodon.me.uk
[#]bbcmicrobot 🚀 MO.1:V.5
DIMX(3),Y(3):D=0
X(0)=4:X(2)=-4:Y(1)=4:Y(3)=-4
MOVE460,760
REP.L=1+L
N=L:T=N:C=0:R=1:Z=1
REP.T=T/2:C=C+1:U.T<=1
M=2^(C-1):E=2^C
REP.
IFN>M ANDN<E R=R+1:Z=2EORZ:N=E-N
E=E/2:M=M/2:U.M<2
D=(D+Z)MOD4
GC.0,1+(R/2)MOD4
PL.65,X(D),Y(D)
U.L>2^15
V.1
=> More informations about this toot | More toots from geoffl@mastodon.me.uk
I ran @geoffl's program and got this.
Source: https://bbcmic.ro/?t=bm52v #bbcbasic
=> More informations about this toot | More toots from bbcmicrobot@mastodon.me.uk
@bbcmicrobot Unnecessary MOD4 in the GCOL.
=> More informations about this toot | More toots from geoffl@mastodon.me.uk
[#]bbcmicrobot 🚀 MO.1:V.5
DIMX(3),Y(3):D=0
X(0)=4:X(2)=-4:Y(1)=4:Y(3)=-4
MOVE460,760
REP.L=1+L
N=L:T=N:C=0:R=1:Z=1
REP.T=T/2:C=C+1:U.T<=1
M=2^(C-1):E=2^C
REP.
IFN>M ANDN<E R=R+1:Z=2EORZ:N=E-N
E=E/2:M=M/2:U.M<2
D=(D+Z)MOD4
GC.0,.1+(R/4)
PL.65,X(D),Y(D)
U.L>2^15
V.1
=> More informations about this toot | More toots from geoffl@mastodon.me.uk
I ran @geoffl's program and got this.
Source: https://bbcmic.ro/?t=bm5z8 #bbcbasic
=> More informations about this toot | More toots from bbcmicrobot@mastodon.me.uk
I don't want to keep spamming the @bbcmicrobot with Dragon Curves so here's a one liner that anyone can run if they feel like it.
MO.0:MOVE460,780:REP.L=-NOTL:T=L:REP.T=T/2:U.T>INTT:D=((1ANDT)2-NOTD)MOD4:PL.65,2((D=3)-(D=1)),2*((D=0)-(D=2)):U.L>2^17:VDU5,1
It calculates the turns in order by taking the bit to the left of the least significant 1 in the binary expansion of a counter. If it's 0 turn right else turn left.
=> More informations about this toot | More toots from geoffl@mastodon.me.uk This content has been proxied by September (3851b).Proxy Information
text/gemini