A019587 The left budding sequence: number of i such that 0 < i <= n and 0 < {phi*i} <= {phi*n}, where {} denotes the fractional part and phi = A001622.
1, 1, 3, 2, 1, 5, 3, 8, 5, 2, 9, 5, 1, 10, 5, 15, 9, 3, 15, 8, 21, 13, 5, 20, 11, 2, 19, 9, 27, 16, 5, 25, 13, 1, 23, 10, 33, 19, 5, 30, 15, 41, 25, 9, 37, 20, 3, 33, 15, 46, 27, 8, 41, 21, 55, 34, 13, 49, 27, 5, 43, 20, 59, 35, 11, 52, 27, 2, 45, 19, 63, 36, 9, 55, 27, 74, 45, 16, 65
Offset: 1
Examples
{r} = 0.61...; {2r} = 0.23...; {3r} = 0.85...; {4r} = 0.47...; so that a(4) = 2.
References
- J. H. Conway, personal communication.
Links
- Reinhard Zumkeller, Table of n, a(n) for n = 1..1000
- Hamoon Mousavi et al., Walnut, An automatic theorem prover for words, version 7.0.
- N. J. A. Sloane, Classic Sequences
Programs
-
Haskell
a019587 n = length $ filter (<= nTau) $ map (snd . properFraction . (* tau) . fromInteger) [1..n] where (_, nTau) = properFraction (tau * fromInteger n) tau = (1 + sqrt 5) / 2 -- Reinhard Zumkeller, Jan 28 2012
-
Maple
Digits := 100; A019587 := proc(n::posint) local a,k,phi,kfrac,nfrac ; phi := (1+sqrt(5))/2 ; a :=0 ; nfrac := n*phi-floor(n*phi) ; for k from 1 to n do kfrac := k*phi-floor(k*phi) ; if evalf(kfrac-nfrac) <= 0 then a := a+1 ; end if; end do: a ; end proc: seq(A019587(n),n=1..100) ; # R. J. Mathar, Aug 13 2021
-
Mathematica
r = GoldenRatio; p[x_] := FractionalPart[x]; u[n_, k_] := If[p[k*r] <= p[n*r], 1, 0] v[n_, k_] := If[p[k*r] > p[n*r], 1, 0] s[n_] := Sum[u[n, k], {k, 1, n}] t[n_] := Sum[v[n, k], {k, 1, n}] Table[s[n], {n, 1, 100}] (* A019587 *) Table[t[n], {n, 1, 100}] (* A194733 *) (* Clark Kimberling, Sep 02 2011 *)
Formula
a(n) + A194733(n) = n.
The theorem prover Walnut (see link) can compute the following "linear representation" for a(n). Let v = [1,0,0,0,0,0,0,0,0,0,0,0], w = [0,1,1,3,2,1,5,3,8,5,2,9]^T, mu(0) =[[1,0,0,0,0,0,0,0,0,0,0,0], [0,0,1,0,0,0,0,0,0,0,0,0], [0,0,0,1,0,0,0,0,0,0,0,0], [0,0,0,0,0,1,0,0,0,0,0,0], [0,0,0,0,0,0,0,1,0,0,0,0], [0,0,0,0,0,0,0,0,1,0,0,0], [0,0,0,0,0,0,0,0,0,0,1,0], [0,0,0,0,0,0,0,0,0,0,0,1], [0,0,0,0,0,0,0,-1,0,0,2,0], [0,0,-2,0,0,1,0,2,0,0,0,0], [0,0,-1,-1,0,1,0,1,1,0,-1,1], [0,0,-1,0,0,0,0,0,0,0,2,0]], mu(1) = [[0,1,0,0,0,0,0,0,0,0,0,0], [0,0,0,0,0,0,0,0,0,0,0,0], [0,0,0,0,1,0,0,0,0,0,0,0], [0,0,0,0,0,0,1,0,0,0,0,0], [0,0,0,0,0,0,0,0,0,0,0,0], [0,0,0,0,0,0,0,0,0,1,0,0], [0,0,0,0,0,0,0,0,0,0,0,0], [0,0,0,0,0,0,-1,0,0,2,0,0], [0,-2,0,0,1,0,2,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0], [0,-1,0,0,0,0,0,0,0,2,0,0], [0,-4,0,0,2,0,4,0,0,-1,0,0]]. Then a(n) = v.mu(x).w, where x is the Zeckendorf (or Fibonacci) representation of n. This gives an algorithm for a(n) that runs in polynomial time in log n. - Jeffrey Shallit, Aug 09 2025
Extensions
Extended by Ray Chandler, Apr 18 2009