cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A317208 The Wythoff representation of n: an alternative way of presenting A189921.

Original entry on oeis.org

0, 1, 2, 12, 112, 22, 1112, 212, 122, 11112, 2112, 1212, 1122, 222, 111112, 21112, 12112, 11212, 2212, 11122, 2122, 1222, 1111112, 211112, 121112, 112112, 22112, 111212, 21212, 12212, 111122, 21122, 12122, 11222, 2222, 11111112, 2111112, 1211112, 1121112
Offset: 0

Views

Author

N. J. A. Sloane, Aug 09 2018

Keywords

Comments

This is an encoding of the position of n in the A000201, A001950 "Wythoff" table T.
Let T denote the following 3-rowed table, whose rows are n, A = A000201(n), B = A001950(n):
n: 1 2 3 .4 .5 .6 .7 .8 .9 ...
A: 1 3 4 .6 .8 .9 11 12 14 ...
B: 2 5 7 10 13 15 18 20 23 ...
Set a(0)=0. For n>0, locate n in rows A and B of the table, and indicate how to reach that entry starting from column 1. For example, 18 = B(7) = B(B(3)) = B(B(A(2))) = B(B(A(B(1)))), so the path to reach 18 is BBAB, which we write (encoding A as 1, B as 2) as a(18) = 2212.
This is another way of writing the Wythoff representation of n described in Lang (1996) and A189921.

References

  • Wolfdieter Lang, The Wythoff and the Zeckendorf representations of numbers are equivalent, in G. E. Bergum et al. (edts.) Application of Fibonacci numbers vol. 6, Kluwer, Dordrecht, 1996, pp. 319-337.

Crossrefs

Cf. A189921, A135817 (length).
Cf. also A317207.

Programs

  • Mathematica
    z[n_] := Floor[(n + 1)*GoldenRatio] - n - 1; h[n_] := z[n] - z[n - 1]; w[n_] := Module[{m = n, zm = 0, hm, s = {}}, While[zm != 1, hm = h[m]; AppendTo[s, hm]; If[hm == 1, zm = z[m], zm = z[z[m]]]; m = zm]; s]; a[n_] := FromDigits[ReplaceAll[w[n], {0 :> 2}]]; a[0] = 0; Array[a, 100, 0] (* Amiram Eldar, Jul 01 2023 *)

Extensions

a(23) and beyond from Lars Blomberg, Aug 11 2018