[go: up one dir, main page]

login
A155940
Triangle read by rows containing Vardi's optimal solution to the glove problem.
1
1, 2, 2, 2, 3, 4, 3, 4, 4, 5, 3, 4, 5, 6, 6, 4, 5, 5, 6, 7, 7, 4, 5, 6, 7, 7, 8, 9, 5, 6, 6, 7, 8, 8, 9, 10, 5, 6, 7, 8, 8, 9, 10, 10, 11, 6, 7, 7, 8, 9, 9, 10, 11, 11, 12, 6, 7, 8, 9, 9, 10, 11, 11, 12, 13, 13, 7, 8, 8, 9, 10, 10, 11, 12, 12, 13, 14, 14, 7
OFFSET
1,2
REFERENCES
A. Hajnal and L. Lovasz, "An Algorithm to Prevent the Propagation of Certain Diseases at Minimum Cost." Section 10.1 in Interfaces Between Computer Science and Operations Research: Proceedings of a Symposium Held at the Mathematisch Centrum, Amsterdam, September 7-10, 1976 (Ed. J. K. Lenstra, A. H. G. Rinnooy Kan and P. van Emde Boas). Amsterdam: Matematisch Centrum, 1978.
I. Vardi, "The Condom Problem." Ch. 10 in Computational Recreations in Mathematica. Redwood City, CA: Addison-Wesley, pp. 203-222, 1991.
LINKS
Nathaniel Johnston, Rows n=1..150, flattened
Ilan Vardi, The condom problem
Eric Weisstein's World of Mathematics, Glove Problem.
FORMULA
a(m,n) = 2 when m = n = 2. a(m,n) = (m+1)/2 when n = 1 and m is odd. a(m,n) = ceiling((m/2) + (2*n/3)) otherwise.
EXAMPLE
The triangle begins:
1
2 2
2 3 4
3 4 4 5
3 4 5 6 6
4 5 5 6 7 7
4 5 6 7 7 8 9
...
MAPLE
A155940 := proc(m, n) if(n=2 and m=2)then return 2: elif(n=1 and m mod 2 = 1)then return (m+1)/2: else return ceil((m/2) + (2*n/3)): fi: end: for m from 1 to 7 do seq(A155940(m, n), n=1..m); od; # Nathaniel Johnston, May 03 2011
MATHEMATICA
vos[{m_, n_}]:=Which[m==n==2, 2, n==1&&OddQ[m], (m+1)/2, True, Ceiling[ m/2+2 n/3]]; Flatten[Table[vos[{m, n}], {m, 20}, {n, m}]] (* Harvey P. Dale, Jun 10 2013 *)
CROSSREFS
Sequence in context: A241504 A342247 A016729 * A186963 A060473 A055034
KEYWORD
easy,nonn,tabl
AUTHOR
Jonathan Vos Post, Jan 31 2009
EXTENSIONS
Edited by Nathaniel Johnston, May 03 2011
STATUS
approved