OFFSET
1,1
COMMENTS
The answer to the strong birthday problem is 3064, that is, a(365) = 3064. This is the number of people that need to be gathered together before there is a 50% chance that everyone in the gathering shares their birthday with at least one other person.
LINKS
Chai Wah Wu, Table of n, a(n) for n = 1..1000
(Note: OEIS uses definition of m and n which are switched from original references)
Mario Cortina Borja, The strong birthday problem, Significance 10.6 (2013): 18-20.
Anirban DasGupta, The matching, birthday and the strong birthday problem: a contemporary review, Journal of Statistical Planning and Inference 130.1-2 (2005): 377-389.
FORMULA
a(n) ~ -n LambertW(-1, -Log(2)/n).
MATHEMATICA
(* a(n)=m, n number of days, m number of people *)
p[n_, m_] :=Sum[((-1)^i*n^(-m)*((-i + n)^((-i) + m))*n!*m!)/(i!*((-i + n)!)*((-i + m)!)), {i, 0, m}];
a[n_] := Module[{m = n + 1, prob = 0}, While[prob < 0.5, prob = p[n, m]; m++; ]; m - 1];
Table[a[n], {n, 1, 20}]
PROG
(Python)
from math import comb, factorial
def A380129(n):
def p(m): return sum((-1 if i&1 else 1)*comb(m, i)*comb(n, i)*factorial(i)*(n-i)**(m-i) for i in range(m+1))<<1
kmin, kmax = n, n+1
while p(kmax) < n**kmax: kmax<<=1
while kmax-kmin > 1:
kmid = kmax+kmin>>1
if p(kmid) >= n**kmid:
kmax = kmid
else:
kmin = kmid
return kmax # Chai Wah Wu, Jan 21 2025
(PARI) p(n, m) = sum(i=0, n, (-1)^i*(n-i)^(m-i)*binomial(n, i)*m!/(m-i)!)/n^m;
a(n) = my(ma, mb=n+1, md); while(2*p(n, mb)<1, mb<<=1); ma=mb\2; while(mb>ma, md=(ma+mb)\2; if(2*p(n, md)<1, ma=md+1, mb=md)); ma; \\ Jinyuan Wang, Jan 24 2025
CROSSREFS
KEYWORD
nonn
AUTHOR
Mike Sheppard, Jan 13 2025
STATUS
approved