Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).
%I #12 Jul 01 2023 09:19:47
%S 1,0,1,2,0,3,1,1,4,2,2,2,0,5,3,3,3,1,3,1,1,6,4,4,4,2,4,2,2,4,2,2,2,0,
%T 7,5,5,5,3,5,3,3,5,3,3,3,1,5,3,3,3,1,3,1,1,8,6,6,6,4,6,4,4,6,4,4,4,2,
%U 6,4,4,4,2,4,2,2,6,4,4,4,2,4,2,2,4,2,2,2,0,9,7,7,7,5,7,5,5,7,5,5,5,3,7,5,5
%N Number of 1's (or A's) in the Wythoff representation of n.
%C a(n) = number of applications of Wythoff's A sequence A000201 needed in the unique Wythoff representation of n>=1.
%C See A135817 for references and links for the Wythoff representation for n>=1.
%H Amiram Eldar, <a href="/A135818/b135818.txt">Table of n, a(n) for n = 1..10000</a>
%e 6 = A(A(A(B(1)))) = AAAB = `1110`, hence a(6)=3.
%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]; w[0] = 0; a[n_] := Total[w[n]]; Array[a, 100] (* _Amiram Eldar_, Jul 01 2023 *)
%Y Cf. A000201, A135817 (lengths of Wythoff representation), A007895 (number of 0's (or B's) in the Wythoff representation).
%K nonn,base,easy
%O 1,4
%A _Wolfdieter Lang_, Jan 21 2008