cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A274011 a(n) is the greatest number of elements in a partition of n into distinct parts such that no two elements add to another.

Original entry on oeis.org

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, 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, 7, 8, 7, 8, 7, 8, 8, 8, 8, 8, 8, 8, 9, 8, 9, 8, 9, 8
Offset: 1

Views

Author

Gordon Hamilton, Jun 06 2016

Keywords

Comments

A lower bound for a(n^2) is n (use the n^2 partition of the first n consecutive odd numbers.)
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

Examples

			a(24) = 5 because {1,2,4,7,10} is a partition of 24 and there are no sum-free partitions with more parts.
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
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.
		

Programs

  • Mathematica
    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 *)

Extensions

a(25)-a(86) from Giovanni Resta, Jun 06 2016