This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.
%I A194733 #24 Aug 16 2022 16:07:57 %S A194733 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, %T A194733 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, %U A194733 22,44,9,32,55,18,42,4,29,54,14,40,66,24,51,8,36,64,19,48,2,32 %N A194733 Number of k < n such that {k*r} > {n*r}, where { } = fractional part, r = (1+sqrt(5))/2 (the golden ratio). %C A194733 The maximum possible value of a(n) is n-1. - _Michael B. Porter_, Jan 29 2012 %H A194733 Reinhard Zumkeller, <a href="/A194733/b194733.txt">Table of n, a(n) for n = 1..1000</a> %F A194733 a(n)+A019587(n)=n. %e A194733 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 %p A194733 Digits := 100; %p A194733 A194733 := proc(n::posint) %p A194733 local a,k,phi,kfrac,nfrac ; %p A194733 phi := (1+sqrt(5))/2 ; %p A194733 a :=0 ; %p A194733 nfrac := n*phi-floor(n*phi) ; %p A194733 for k from 1 to n-1 do %p A194733 kfrac := k*phi-floor(k*phi) ; %p A194733 if evalf(kfrac-nfrac) > 0 then %p A194733 a := a+1 ; %p A194733 end if; %p A194733 end do: %p A194733 a ; %p A194733 end proc: %p A194733 seq(A194733(n),n=1..100) ; # _R. J. Mathar_, Aug 13 2021 %t A194733 r = GoldenRatio; p[x_] := FractionalPart[x]; %t A194733 u[n_, k_] := If[p[k*r] <= p[n*r], 1, 0] %t A194733 v[n_, k_] := If[p[k*r] > p[n*r], 1, 0] %t A194733 s[n_] := Sum[u[n, k], {k, 1, n}] %t A194733 t[n_] := Sum[v[n, k], {k, 1, n}] %t A194733 Table[s[n], {n, 1, 100}] (* A019587 *) %t A194733 Table[t[n], {n, 1, 100}] (* A194733 *) %o A194733 (Haskell) %o A194733 a194733 n = length $ filter (nTau <) $ %o A194733 map (snd . properFraction . (* tau) . fromInteger) [1..n] %o A194733 where (_, nTau) = properFraction (tau * fromInteger n) %o A194733 tau = (1 + sqrt 5) / 2 %o A194733 -- _Reinhard Zumkeller_, Jan 28 2012 %Y A194733 Cf. A019587, A194738. %K A194733 nonn %O A194733 1,4 %A A194733 _Clark Kimberling_, Sep 02 2011