login
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

%I #17 Jun 24 2020 04:58:47

%S 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,

%T 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,

%U 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

%N 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).

%C From _Robert Israel_, Aug 29 2018: (Start)

%C a(n) <= sqrt(n), with equality if n is a square.

%C a(n) >= A033676(n).

%C a(m+n) >= min(a(m), a(n)). (End)

%H Robert Israel, <a href="/A046805/b046805.txt">Table of n, a(n) for n = 1..10000</a>

%e a(13)=2 since 13=2*2+3*3.

%p A046805 := proc(n)

%p local p,a,abmin,divmin;

%p a := 0 ;

%p for p in combinat[partition](n) do

%p abmin := 1+n ;

%p for abprod in p do

%p divmin := A033676(abprod) ;

%p abmin := min(abmin,divmin) ;

%p end do:

%p a := max(a,abmin) ;

%p end do:

%p a ;

%p end proc: # _R. J. Mathar_, Oct 12 2015

%p # alternative program:

%p f:= proc(n) option remember; local v,a,b,vmax;

%p if issqr(n) then return sqrt(n) fi;

%p vmax:= 1;

%p for a from floor(sqrt(n)) by -1 while a > vmax do

%p for b from a to n/a do

%p v:= min(a, procname(n - a*b));

%p vmax:= max(vmax,v);

%p od od;

%p vmax

%p end proc:

%p f(0):= infinity:

%p map(f, [$1..200]); # _Robert Israel_, Aug 29 2018

%t 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];

%t f[0] = Infinity;

%t Array[f, 200] (* _Jean-François Alcover_, Jun 23 2020, after _Robert Israel_ *)

%Y Cf. A033676.

%K easy,nice,nonn,look

%O 1,4

%A _Erich Friedman_