|
|
A019588
|
|
The right budding sequence: # of i such that 0 < i <= n and {tau*n} <= {tau*i} < 1, where {} is fractional part.
|
|
4
|
|
|
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, 15, 27, 8, 21, 34, 13, 27, 5, 20, 35, 11, 27, 2, 19, 36, 9, 27, 45, 16, 35, 5, 25, 45, 13, 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
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
1,2
|
|
REFERENCES
|
J. H. Conway, personal communication.
|
|
LINKS
|
|
|
FORMULA
|
|
|
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}] (* A019588 *)
Table[t[n], {n, 1, 100}] (* A194734 *)
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 *)
|
|
PROG
|
(Haskell)
a019588 n = length $ filter (nTau <=) $
map (snd . properFraction . (* tau) . fromInteger) [1..n]
where (_, nTau) = properFraction (tau * fromInteger n)
tau = (1 + sqrt 5) / 2
|
|
CROSSREFS
|
|
|
KEYWORD
|
nonn,easy,nice
|
|
AUTHOR
|
|
|
EXTENSIONS
|
|
|
STATUS
|
approved
|
|
|
|