%I #12 Jun 06 2016 23:04:57
%S 1,1,2,2,2,2,3,3,3,3,3,3,3,4,4,4,4,4,4,4,4,4,4,5,5,5,5,5,5,5,5,5,5,5,
%T 5,6,6,6,6,6,6,6,6,6,6,6,6,6,7,6,7,6,7,6,7,7,7,7,7,7,7,7,7,8,7,8,7,8,
%U 7,8,7,8,7,8,8,8,8,8,8,8,9,8,9,8,9,8
%N a(n) is the greatest number of elements in a partition of n into distinct parts such that no two elements add to another.
%C A lower bound for a(n^2) is n (use the n^2 partition of the first n consecutive odd numbers.)
%C An upper bound u for a(n) is found by a partition of A057944(n); [1,..,u]. This gives u = floor((floor(sqrt(8*n+7))-1)/2). - _David A. Corneth_, Jun 06 2016
%e a(24) = 5 because {1,2,4,7,10} is a partition of 24 and there are no sum-free partitions with more parts.
%e Candidates for such a partition of size 5 of 24 are found by adding [0,1,2,3,4] to partitions of 5 of 24 - (0+1+2+3+4). - _David A. Corneth_, Jun 06 2016
%e a(25) = 5 because {1,3,5,7,9} is a partition of 25. {1,2,4,7,11} does not show that a(25) >= 5 because 4,7, and 11 are all elements of the set and 4+7=11.
%t dif[w_] := Length[w] <= 2 || {} == Intersection[w, Reap[ Do[ Sow[w[[i]] + w[[j]]], {i, Length@ w}, {j, i-1}]][[2, 1]]]; p[tg_, w_] := If[tg == 0, bst = Max[bst, Length@ w], Block[{v=If[w == {}, 0, Last@w], u}, Do[u = Append[w, k]; If[dif@ u, p[tg-k, u]], {k, v+1, tg}]]]; a[n_] := (bst = 0; p[n, {}]; bst); Array[a, 50] (* _Giovanni Resta_, Jun 06 2016 *)
%K nonn
%O 1,3
%A _Gordon Hamilton_, Jun 06 2016
%E a(25)-a(86) from _Giovanni Resta_, Jun 06 2016