login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A194733 Number of k < n such that {k*r} > {n*r}, where { } = fractional part, r = (1+sqrt(5))/2 (the golden ratio). 4
0, 1, 0, 2, 4, 1, 4, 0, 4, 8, 2, 7, 12, 4, 10, 1, 8, 15, 4, 12, 0, 9, 18, 4, 14, 24, 8, 19, 2, 14, 26, 7, 20, 33, 12, 26, 4, 19, 34, 10, 26, 1, 18, 35, 8, 26, 44, 15, 34, 4, 24, 44, 12, 33, 0, 22, 44, 9, 32, 55, 18, 42, 4, 29, 54, 14, 40, 66, 24, 51, 8, 36, 64, 19, 48, 2, 32 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,4
COMMENTS
The maximum possible value of a(n) is n-1. - Michael B. Porter, Jan 29 2012
LINKS
FORMULA
a(n)+A019587(n)=n.
EXAMPLE
r = 1.618, 2r = 3.236, 3r = 4.854, and 4r = 6.472, where r=(1+sqrt(5))/2. The fractional part of 4r is 0.472, which is less than the fractional parts of two of {r, 2r, 3r}, so a(4) = 2. - Michael B. Porter, Jan 29 2012
MAPLE
Digits := 100;
A194733 := 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-1 do
kfrac := k*phi-floor(k*phi) ;
if evalf(kfrac-nfrac) > 0 then
a := a+1 ;
end if;
end do:
a ;
end proc:
seq(A194733(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 *)
PROG
(Haskell)
a194733 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
Sequence in context: A371767 A157284 A361523 * A143973 A011167 A014176
KEYWORD
nonn
AUTHOR
Clark Kimberling, Sep 02 2011
STATUS
approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 28 09:53 EDT 2024. Contains 372037 sequences. (Running on oeis4.)