OFFSET
1,2
REFERENCES
J. H. Conway, personal communication.
LINKS
Reinhard Zumkeller, Table of n, a(n) for n = 1..1000
N. J. A. Sloane, Classic Sequences
FORMULA
a(n) = A194733(n) + 1.
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 *)
(* Clark Kimberling, Sep 02 2011 *)
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
-- Reinhard Zumkeller, Jan 28 2012
CROSSREFS
KEYWORD
nonn,easy,nice
AUTHOR
EXTENSIONS
Extended by Ray Chandler, Apr 18 2009
STATUS
approved