OFFSET
2,1
COMMENTS
Among n randomly selected dates over an interval of m days (or less), the odds are even (or better than even) for two or more of them to coincide.
FORMULA
Corresponds to the ultimate occurrence of n in A033810. For large n, m has magnitude n^2 / 2 * log(2).
EXAMPLE
Thus a(7)=32 for instance implies that among 7 persons bearing the same astrological sign(extending over 30 days or so) the odds are trifle better than even for at least two of them further sharing a common birthday.
MATHEMATICA
f[n_] := (k = 1; While[ Product[1 - i/k, {i, 1, (n - 1)}] <= 1/2, k++ ]; Return[k - 1]); Table[ f[n], {n, 2, 53}]
PROG
(Python)
from math import factorial, comb
def A072829(n):
f = factorial(n)
def p(m): return comb(m, n)*f<<1
kmin, kmax = n-1, n
while p(kmax) <= kmax**n: kmax<<=1
while kmax-kmin > 1:
kmid = kmax+kmin>>1
if p(kmid) > kmid**n:
kmax = kmid
else:
kmin = kmid
return kmin # Chai Wah Wu, Jan 21 2025
CROSSREFS
KEYWORD
nonn
AUTHOR
Lekraj Beedassy, Jul 22 2002
EXTENSIONS
Edited and extended by Robert G. Wilson v, Jul 23 2002
More terms from David Terr, Jan 03 2005
STATUS
approved