%I #33 Sep 03 2023 08:44:44
%S 1,2,1,3,5,2,5,1,5,9,3,8,13,5,11,2,9,16,5,13,1,10,19,5,15,25,9,20,3,
%T 15,27,8,21,34,13,27,5,20,35,11,27,2,19,36,9,27,45,16,35,5,25,45,13,
%U 34,1,23,45,10,33,56,19,43,5,30,55,15,41,67,25,52,9,37,65,20,49,3,33,63,15
%N The right budding sequence: # of i such that 0 < i <= n and {tau*n} <= {tau*i} < 1, where {} is fractional part.
%D J. H. Conway, personal communication.
%H Reinhard Zumkeller, <a href="/A019588/b019588.txt">Table of n, a(n) for n = 1..1000</a>
%H N. J. A. Sloane, <a href="/classic.html#WYTH">Classic Sequences</a>
%F a(n) = A194733(n) + 1.
%t r = -GoldenRatio; p[x_] := FractionalPart[x];
%t u[n_, k_] := If[p[k*r] <= p[n*r], 1, 0]
%t v[n_, k_] := If[p[k*r] > p[n*r], 1, 0]
%t s[n_] := Sum[u[n, k], {k, 1, n}]
%t t[n_] := Sum[v[n, k], {k, 1, n}]
%t Table[s[n], {n, 1, 100}] (* A019588 *)
%t Table[t[n], {n, 1, 100}] (* A194734 *)
%t (* _Clark Kimberling_, Sep 02 2011 *)
%t Fold[Join[#1, Range[#1[[#2]], Length[#1] + 1 + Floor[GoldenRatio (#2 + 1)] - Floor[GoldenRatio #2], #2 + 1]] &, {1, 2}, Range[30]] (* _Birkas Gyorgy_, May 24 2012 *)
%o (Haskell)
%o a019588 n = length $ filter (nTau <=) $
%o map (snd . properFraction . (* tau) . fromInteger) [1..n]
%o where (_, nTau) = properFraction (tau * fromInteger n)
%o tau = (1 + sqrt 5) / 2
%o -- _Reinhard Zumkeller_, Jan 28 2012
%Y Cf. A019587, A194734, A194738.
%K nonn,easy,nice
%O 1,2
%A _N. J. A. Sloane_ and _J. H. Conway_
%E Extended by _Ray Chandler_, Apr 18 2009