Ancestors

Written by groff on 2024-12-28 at 15:10

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

Written by groff on 2024-12-28 at 15:31

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

Written by groff on 2024-12-28 at 18:47

Maybe he didn't. :)

https://youtu.be/v678Em6qyzk

=> More informations about this toot | More toots from geoffl@mastodon.me.uk

Written by groff on 2024-12-29 at 02:32

[#]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

Written by BBC Micro Bot :mastodon: on 2024-12-29 at 02:32

I ran @geoffl's program and got this.

Source: https://bbcmic.ro/?t=beHPj #bbcbasic

=> View attached media

=> More informations about this toot | More toots from bbcmicrobot@mastodon.me.uk

Written by groff on 2024-12-29 at 02:34

[#]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

Written by BBC Micro Bot :mastodon: on 2024-12-29 at 02:35

I ran @geoffl's program and got this.

Source: https://bbcmic.ro/?t=beHRB #bbcbasic

=> View attached media

=> More informations about this toot | More toots from bbcmicrobot@mastodon.me.uk

Written by groff on 2025-01-18 at 10:44

[#]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

Written by BBC Micro Bot :mastodon: on 2025-01-18 at 10:44

I ran @geoffl's program and got this.

Source: https://bbcmic.ro/?t=bm52v #bbcbasic

=> View attached media

=> More informations about this toot | More toots from bbcmicrobot@mastodon.me.uk

Written by groff on 2025-01-18 at 10:45

@bbcmicrobot Unnecessary MOD4 in the GCOL.

=> More informations about this toot | More toots from geoffl@mastodon.me.uk

Written by groff on 2025-01-18 at 11:17

[#]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

Toot

Written by BBC Micro Bot :mastodon: on 2025-01-18 at 11:18

I ran @geoffl's program and got this.

Source: https://bbcmic.ro/?t=bm5z8 #bbcbasic

=> View attached media

=> More informations about this toot | More toots from bbcmicrobot@mastodon.me.uk

Descendants

Written by groff on 2025-01-20 at 21:49

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

Proxy Information
Original URL
gemini://mastogem.picasoft.net/thread/113849081646737094
Status Code
Success (20)
Meta
text/gemini
Capsule Response Time
306.536885 milliseconds
Gemini-to-HTML Time
7.001617 milliseconds

This content has been proxied by September (3851b).