OFFSET
2,1
COMMENTS
F(n) is the maximal flow in a network whose nodes are the divisors of n, with an edge from a to b if and only if b/a is a prime factor of n, in which case the capacity of the edge is b/a. The source of the network is 1 and the sink is n.
LINKS
Alois P. Heinz, Table of n, a(n) for n = 2..10000
Wikipedia, Maximum flow problem
Wikipedia, Max-flow min-cut theorem
FORMULA
a(n) = min_{S:P([m])\{}} Product_{i:[m]\S} (e_i+1) * Sum_{i:S} p_i, where n = Product_{i=1..m} p_i^e_i and P([m]) is the powerset of {1,...,m}.
MAPLE
with(combinat):
a:= proc(n) local S, s, f, l, m;
f:= infinity; l:= ifactors(n)[2]; m:= nops(l);
S:= subsets({$1..m}):
while not S[finished] do s:= S[nextvalue]();
if s={} then next fi:
f:= min(f, mul(1+l[i][2], i=({$1..m} minus s))*add(l[i][1], i=s))
od; f
end:
seq(a(n), n=2..100); # Alois P. Heinz, Mar 04 2014
MATHEMATICA
F[n_] := F[n] = Module[{v, e, flowgraph, flow},
v = Divisors[n];
e = Apply[DirectedEdge,
Select[Subsets[v, {2}], PrimeQ[Last[#]/First[#]] &], {1}];
flowgraph =
Graph[e, EdgeCapacity -> Map[Rule[#, (Divide @@ Reverse[#])] &, e]];
flow = FindMaximumFlow[flowgraph, 1, n, "OptimumFlowData"];
flow["FlowValue"]]
CROSSREFS
KEYWORD
nonn
AUTHOR
Ken Levasseur, Mar 03 2014
STATUS
approved