OFFSET
2,1
COMMENTS
Start with k = 1; right to left "digits": 2 means k <= 2k, 1 means k <= (k-1)/3. (1 has the empty "wondrous representation," since it is "wondrous" by definition ... although, for a nonempty representation, we could [in a kludgy way] represent 1 using the trivial cycle: 122.)
"Wondrous numbers" (Hofstadter, 1979, pp. 400-401) are positive integers with a Collatz trajectory that eventually reaches 1.
According to the Collatz conjecture, every positive integer is "wondrous" (none is "unwondrous"). Thus, every positive integer n >= 2 is conjectured to have a "wondrous representation," which is then unique.
Reading the "digits" left to right gives the Collatz trajectory of n, n >= 2. Start with n; left to right "digits": 2 means k <= k/2, 1 means k <= 3k+1.
For a representation to be well-formed, we can only prepend a "digit" 1 if the number reached to the right is congruent to 4 (mod 6), yielding an odd number after prepending 1. We can prepend "digit" 2 without any restriction. Thus a(n) is odd iff it starts with 1.
REFERENCES
Douglas R. Hofstadter, "Gödel, Escher, Bach: an Eternal Golden Braid." New York: Basic Books, 1979.
LINKS
Andrew Howroyd, Table of n, a(n) for n = 2..1000
EXAMPLE
a(3) = 1212222: [right to left] 3 <= 10 <= 5 <= 16 <= 8 <= 4 <= 2 <= (1).
PROG
(PARI) a(n)={my(L=List()); while(n<>1, listput(L, 2-n%2); n=if(n%2, n*3+1, n/2)); fromdigits(Vec(L))} \\ Andrew Howroyd, Apr 27 2020
CROSSREFS
KEYWORD
nonn
AUTHOR
Daniel Forgues, Apr 23 2018
EXTENSIONS
Term a(18) and beyond from Andrew Howroyd, Apr 27 2020
STATUS
approved