|
|
A046805
|
|
If n=sum a_i b_i, (a_i,b_i positive integers) then a(n)=max value of min(all a_i and b_i).
|
|
2
|
|
|
1, 1, 1, 2, 1, 2, 1, 2, 3, 2, 1, 3, 2, 2, 3, 4, 2, 3, 2, 4, 3, 2, 2, 4, 5, 2, 3, 4, 3, 5, 3, 4, 3, 3, 5, 6, 3, 3, 3, 5, 4, 6, 3, 4, 5, 4, 3, 6, 7, 5, 4, 4, 4, 6, 5, 7, 4, 4, 4, 6, 5, 4, 7, 8, 5, 6, 5, 4, 4, 7, 5, 8, 5, 5, 5, 5, 7, 6, 5, 8, 9, 5, 5, 7, 6, 5, 5, 8, 5, 9, 7, 6, 5, 5, 5, 8, 6, 7, 9, 10, 5, 6, 6, 8
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
1,4
|
|
COMMENTS
|
a(n) <= sqrt(n), with equality if n is a square.
a(m+n) >= min(a(m), a(n)). (End)
|
|
LINKS
|
|
|
EXAMPLE
|
a(13)=2 since 13=2*2+3*3.
|
|
MAPLE
|
local p, a, abmin, divmin;
a := 0 ;
for p in combinat[partition](n) do
abmin := 1+n ;
for abprod in p do
abmin := min(abmin, divmin) ;
end do:
a := max(a, abmin) ;
end do:
a ;
# alternative program:
f:= proc(n) option remember; local v, a, b, vmax;
if issqr(n) then return sqrt(n) fi;
vmax:= 1;
for a from floor(sqrt(n)) by -1 while a > vmax do
for b from a to n/a do
v:= min(a, procname(n - a*b));
vmax:= max(vmax, v);
od od;
vmax
end proc:
f(0):= infinity:
|
|
MATHEMATICA
|
f[n_] := f[n] = Module[{v, a, b, vMax}, If[IntegerQ[Sqrt[n]], Return[ Sqrt[n]]]; vMax = 1; For[a = Floor[Sqrt[n]], a > vMax, a--, For[b = a, b <= n/a, b++, v = Min[a, f[n - a b]]; vMax = Max[vMax, v]]]; vMax];
f[0] = Infinity;
|
|
CROSSREFS
|
|
|
KEYWORD
|
|
|
AUTHOR
|
|
|
STATUS
|
approved
|
|
|
|