A186053 Smallest perimeter among all sets of nonnegative integers whose volume (sum) is n.
0, 1, 2, 2, 4, 5, 3, 6, 7, 6, 4, 8, 8, 9, 7, 5, 10, 11, 9, 10, 8, 6, 11, 12, 13, 10, 11, 9, 7, 14, 12, 13, 14, 11, 12, 10, 8, 16, 16, 13, 14, 15, 12, 13, 11, 9, 16, 17, 17, 14, 15, 16, 13, 14, 12, 10, 16, 17, 18, 18, 15, 16, 17, 14, 15, 13, 11, 22, 17, 18, 19, 19, 16, 17
Offset: 0
Keywords
Examples
For n=8, the set S={0,1,2,5} has sum 8 and the perimeter 7 (the sum of 2 and 5). No other set of volume 8 has a smaller perimeter, so a(8)=7.
Links
- Joerg Arndt and Alois P. Heinz, Table of n, a(n) for n = 0..2000 (terms n = 0..201 from Joerg Arndt)
- Patrick Devlin, Sets with High Volume and Low Perimeter, arXiv:1107.2954 [math.CO], 2011.
- Patrick Devlin, Integer Subsets with High Volume and Low Perimeter, arXiv:1202.1331 [math.CO], 2012.
- Patrick Devlin, Integer Subsets with High Volume and Low Perimeter, INTEGERS, Vol. 12, #A32.
- J. Miller, F. Morgan, E. Newkirk, L. Pedersen and D. Seferis, Isoperimetric Sets of Integers, Math. Mag. 84 (2011) 37-42.
Crossrefs
Cf. A227538.
Programs
-
Maple
b:= proc(n, i, t) option remember; `if`(n=0 and i<>0, `if`(t>1, i+1, 0), `if`(i<0, infinity, min(`if`(t>1, i+1, 0)+b(n, i-1, iquo(t, 2)), `if`(i>n, NULL, `if`(t=2, i+1, 0)+b(n-i, i-1, iquo(t, 2)+2))))) end: a:= n-> b(n$2, 0): seq(a(n), n=0..100); # Alois P. Heinz, Jul 23 2013
-
Mathematica
notBoth[lst_List] := Select[lst, !MemberQ[lst, #-1] || !MemberQ[lst, #+1]&]; Table[s=Select[IntegerPartitions[n], Length[#]==Length[Union[#]]&]; s=Append[#,0]&/@s; Min[Table[Plus@@notBoth[i], {i,s}]], {n,40}] (* Second program: *) b[n_, i_, t_] := b[n, i, t] = If[n == 0 && i != 0, If[t > 1, i+1, 0], If[ i<0, Infinity, Min[If[t>1, i+1, 0] + b[n, i-1, Quotient[t, 2]], If[i > n, Infinity, If[t == 2, i+1, 0] + b[n-i, i-1, Quotient[t, 2]+2]]]]]; a[n_] := b[n, n, 0]; Table[a[n], {n, 0, 100}] (* Jean-François Alcover, Aug 29 2016, after Alois P. Heinz *)
Formula
If t(n) is a triangular number t(n)=n*(n+1)/2, then a(t(n))=n.
a(n) = A002024(n) + A182298(A025581(n)) unless n is one of the 114 known counterexamples listed in A182246. This allows the n-th term to be calculated in order log(log(n)) time using constant memory. The first n terms can be calculated in order n time (using order n memory). [Result and details in above listed paper by Patrick Devlin (2012).]
Comments