%I #21 Jul 01 2023 08:29:51
%S 0,1,2,12,112,22,1112,212,122,11112,2112,1212,1122,222,111112,21112,
%T 12112,11212,2212,11122,2122,1222,1111112,211112,121112,112112,22112,
%U 111212,21212,12212,111122,21122,12122,11222,2222,11111112,2111112,1211112,1121112
%N The Wythoff representation of n: an alternative way of presenting A189921.
%C This is an encoding of the position of n in the A000201, A001950 "Wythoff" table T.
%C Let T denote the following 3-rowed table, whose rows are n, A = A000201(n), B = A001950(n):
%C n: 1 2 3 .4 .5 .6 .7 .8 .9 ...
%C A: 1 3 4 .6 .8 .9 11 12 14 ...
%C B: 2 5 7 10 13 15 18 20 23 ...
%C 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.
%C This is another way of writing the Wythoff representation of n described in Lang (1996) and A189921.
%D 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.
%H Lars Blomberg, <a href="/A317208/b317208.txt">Table of n, a(n) for n = 0..10000</a>
%H Wolfdieter Lang, <a href="/A317208/a317208.pdf">The Wythoff and the Zeckendorf representations of numbers are equivalent</a>, in G. E. Bergum et al. (edts.) Application of Fibonacci numbers vol. 6, Kluwer, Dordrecht, 1996, pp. 319-337. [Corrected scanned copy, with permission of the author.]
%t 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 *)
%Y Cf. A189921, A135817 (length).
%Y Cf. also A317207.
%Y Cf. A000201, A001950.
%K nonn,base
%O 0,3
%A _N. J. A. Sloane_, Aug 09 2018
%E a(23) and beyond from _Lars Blomberg_, Aug 11 2018