OEIS sequence A073057 by Roger L. Bagula is an initial 1,2,3,4 then repeatedly take the sequence so-far and append a copy of it expanded by morphism

1 -> 12, 2 -> 13, 3 -> 42, 4 -> 43

A073057 = 1,2,3,4, 1,2,1,3,4,2,4,3, 1,2,1,3,4,2,4,3,1,2,1,3,...

The PARI/GP code here is a mixture of code and description for calculating a term of A073057 from its index n. The appends give "morphism block" lengths which are Gould's sequence and finding which one contains n, and how far n is into it, gives a term.

The accompanying PDF shows state machines used, and alternate paperfolding curve "figure of 8" loops which result from taking the sequence values as segment directions E,N,S,W.

`a073057-code.gp`

is
free software (free
as in freedom), published under the terms of the
GNU
General Public License (v3 or higher). Download version 1,

`a073057-code.gp`

(24k, and sig)

`a073057-diagrams.pdf`

(152 kbytes, 3 pages)

`a073057-append-morphism-1.tar.gz`

(80k, and sig)

The sig files are Gnu PG ascii armoured
signatures generated from my key. Just
`a073057-code.gp`

is the code and notes. The `.tar.gz`

includes LaTeX+PGF source for the diagrams, and some slightly rough tools used
for state machine manipulations and checking.

See my alternate paperfolding curve write-up for more on its segment directions, extents, etc.

This page Copyright 2021 Kevin Ryde.