OFFSET
1,4
COMMENTS
a(n) is the greatest m such that floor(n/m^2) > n/(m^2+m). - Robert Israel, Jun 04 2019
LINKS
Robert Israel, Table of n, a(n) for n = 1..10000
EXAMPLE
For n = 10, we have the pairs {k,floor(n/k)} of {1,10},{2,5},{3,3},{4,2},{5,2},{6,1},{7,1},{8,1},{9,1},{10,1}. The GCD's of these 10 pairs are 1,1,3,2,1,1,1,1,1,1. Of these, 3 is the largest. So a(10) = 3.
MAPLE
a:=n->max(seq(gcd(k, floor(n/k)), k=1..n)): seq(a(n), n=1..112); # Emeric Deutsch, Jul 24 2006
# Alternative:
f:= proc(n) local m, a;
for m from floor(sqrt(n)) by -1 do
a:= floor(n/m^2);
if n < a*(m^2+m) then return m fi
od
end proc:
map(f, [$1..200]); # Robert Israel, Jun 04 2019
MATHEMATICA
Table[Max[Table[GCD[k, Floor[n/k]], {k, 1, n}]], {n, 1, 100}] (* Stefan Steinerberger, Jul 22 2006 *)
CROSSREFS
KEYWORD
nonn,look
AUTHOR
Leroy Quet, Jul 11 2006
EXTENSIONS
More terms from Stefan Steinerberger and Emeric Deutsch, Jul 22 2006
STATUS
approved