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.

A135818 Number of 1's (or A's) in the Wythoff representation of n.

This page as a plain text file.
%I A135818 #12 Jul 01 2023 09:19:47
%S A135818 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 A135818 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 A135818 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 A135818 Number of 1's (or A's) in the Wythoff representation of n.
%C A135818 a(n) = number of applications of Wythoff's A sequence A000201 needed in the unique Wythoff representation of n>=1.
%C A135818 See A135817 for references and links for the Wythoff representation for n>=1.
%H A135818 Amiram Eldar, <a href="/A135818/b135818.txt">Table of n, a(n) for n = 1..10000</a>
%e A135818 6 = A(A(A(B(1)))) = AAAB = `1110`, hence a(6)=3.
%t A135818 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 A135818 Cf. A000201, A135817 (lengths of Wythoff representation), A007895 (number of 0's (or B's) in the Wythoff representation).
%K A135818 nonn,base,easy
%O A135818 1,4
%A A135818 _Wolfdieter Lang_, Jan 21 2008