OFFSET
1,1
COMMENTS
a(365) = 23 is the solution to the Birthday Problem.
LINKS
T. D. Noe and Charles R Greathouse IV, Table of n, a(n) for n = 1..10000 (366 terms from T. D. Noe)
S. E. Ahmed and R. J. McIntosh, An Asymptotic Approximation for the Birthday Problem, Crux Mathematicorum 26(3) 151-5 2000 CMS.
D. Brink, A (probably) exact solution to the Birthday Problem, Ramanujan Journal, June 2012, Volume 28, Issue 2, pp. 223-238. - From N. J. A. Sloane, Oct 08 2012
Mathforum, The Birthday Problem.
Eric Weisstein's World of Mathematics, Birthday Problem.
FORMULA
a(n) = ceiling(sqrt(2*n*log(2)) + (3 - 2*log(2))/6 + (9 - 4*log(2)^2) / (72*sqrt(2*n*log(2))) - 2*log(2)^2/(135*n)) for all n up to 10^18. It is conjectured that this formula holds for all n.
MATHEMATICA
lst = {}; s = 1; Do[Do[If[Product[(n - i + 1)/n, {i, j}] <= 1/2, If[j > s, s = j]; AppendTo[lst, j]; Break[]], {j, s, s + 1}], {n, 86}]; lst (* Arkadiusz Wesolowski, Apr 29 2012 *)
A033810[n_] := Catch@Do[If[1/2 >= n!/(n - m)!/n^m, Throw[m]], {m, 2, Infinity}]; Array[A033810, 86] (* JungHwan Min, Mar 27 2017 *)
Ceiling[Table[n /. FindRoot[d^-n d!/(d - n)! == 1/2, {n, 1, 2}, WorkingPrecision -> 10], {d, 100}]] (* Eric W. Weisstein, Nov 25 2025 *)
PROG
(Python)
from math import comb, factorial
def A033810(n):
def p(m): return comb(n, m)*factorial(m)<<1
kmin, kmax = 0, 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
CROSSREFS
Cf. A380129 (Strong Birthday Problem).
KEYWORD
nonn,easy,nice
AUTHOR
STATUS
approved
