a)
We can pass through the first half of the list of divisors to avoid duplicating factors. There are many possible ways to proceed, let's mention a few of them :
f1[n_] := {#, n/#} & /@ First @ Partition[ #, Ceiling[ Length[#]/2] ] & @ Divisors[n]
or
f2[n_] := Module[{k, l}, k = Divisors @ n; l = Length @ k;
Table[{k[[i]], k[[l + 1 - i]]}, {i, Ceiling[l/2] }] ]
or a completely different (less efficient) approach :
f3[n_Integer] /; n > 0 := Solve[x y == n && 0 < x <= y, {x, y}, Integers][[All, All, 2]]
e.g.
f1[37900003]
And @@ (f1[#] == f2[#] == f3[#] & /@ Range[100, 200])
{{1, 37900003}, {19, 1994737}, {131, 289313}, {2489, 15227}}
True
b)
Let's point out three different ways, using various Mathematica functions, respectively IntegerPartitions, FrobeniusSolve and PowersRepresentations :
g1[n_Integer /; n > 0] := IntegerPartitions[n, {2}]
g2[n_Integer /; n > 0] := FrobeniusSolve[{1, 1}, n]
g3[n_Integer /; n > 0] := PowersRepresentations[n, 2, 1]
All these functions yield outputs in different forms; g2, g3 include zeros, in g2 the ordering is valid, e.g.
g1[15]
{{14, 1}, {13, 2}, {12, 3}, {11, 4}, {10, 5}, {9, 6}, {8, 7}}
g2[15]
{{0, 15}, {1, 14}, {2, 13}, {3, 12}, {4, 11}, {5, 10}, {6, 9}, {7, 8},
{8, 7}, {9, 6}, {10, 5}, {11, 4}, {12, 3}, {13, 2}, {14, 1}, {15, 0}}
g3[15]
{{0, 15}, {1, 14}, {2, 13}, {3, 12}, {4, 11}, {5, 10}, {6, 9}, {7, 8}}
We can get rid of 0, e.g. wrapping g2 or g3 in DeleteCases, e.g. :
DeleteCases[ g3[15], {___, 0, ___}]
{{1, 14}, {2, 13}, {3, 12}, {4, 11}, {5, 10}, {6, 9}, {7, 8}}
A more general approach is PowersRepresentations[n,k,p], which gives the distinct representations of the integer n as a sum of k non-negative p -th integer powers, e.g. PowersRepresentations[n, 2, 3] gives all possible natural pairs {a,b} satisfying : $\; a^3+b^3 = n $, e.g. :
PowersRepresentations[855, 2, 3]
{{7, 8}}
indeed 7^3 + 8^3 == 855.
Using g1 or g3 we needn't to eliminate sets which only differ in order, anyway one can use DeleteDuplicates or Union, e.g. :
Union[{{a, b}, {b, c}, {c, a}, {b, a}, {a, c}}, SameTest -> (Sort[#1] === Sort[#2] &)]
and
DeleteDuplicates[{{a, b}, {b, c}, {c, a}, {b, a}, {a, c}}, Sort[#1] == Sort[#2] &]
yield :
{{a, b}, {a, c}, {b, c}}
IntegerPartitions[]? – J. M.'s missing motivation Nov 23 '12 at 10:51