6

My date of birth as DDMMYYYY is a prime number. I have a bit of a thing for prime numbers so I thought that was pretty cool. I wondered whether that's really special.

I already figured that less than $50\%$ of the people have that because even birth years are never prime. So let's only consider people born in the $20^{th}$ century and that every date is equally likely, how many percent of the people have a prime birth date?

And does it differ much if I would take the MMDDYYYY format instead? (In that format my date of birth isn't prime, too bad)

Apurv
  • 3,363
  • 2
  • 26
  • 47
Ivo
  • 296
  • $\frac{1}{\log(10000)}\approx 10,86%$, so the primality of a birthday is not so rare. – Jack D'Aurizio Oct 23 '15 at 12:35
  • 1
    @Jack: No one who was born the same year as me has a prime birthday. – Asaf Karagila Oct 23 '15 at 12:35
  • 1
    As a rough approximation you might ask how many numbers are primes between $01000000$ and $12000000$, as the possible months constrain the integers. For a finer evaluation you could treat each month separately and average the results. Finally, it is not beyond question that you could treat each date possibility and count the number of them which are primes. – hardmath Oct 23 '15 at 12:36
  • 1
    Does limiting DD to 1...31 have much effect on the proportion of primes? Does limiting MM to 1...12? How about limiting YYYY to 1900...1999? – GEdgar Oct 23 '15 at 12:39

2 Answers2

3

Putting this through a computer (i.e. looking at all 36524 days from 01011900 to 31121999 including leap years) gave me only 2175 days which were prime.

For completeness:

In DDMMYYYY there are 2175 primes.

In MMDDYYYY there are 2368 primes.

In DDYYYYMM there are 2334 primes.

In MMYYYYDD there are 2412 primes.

In YYYYMMDD there are 2259 primes.

In YYYYDDMM there are 2235 primes.

Ian Miller
  • 11,844
  • 3
    Those "only" 2175 days are still about 6% of the dates in the range, which matches the prime number theorem's estimate pretty well. – hmakholm left over Monica Oct 23 '15 at 12:43
  • @derpy thanks for the addition. could you maybe also check how many people have prime dates in both MMDDYYYY and DDMMYYYY at the same time. I guess they should be very rare – Ivo Oct 23 '15 at 12:47
  • I need to modify my horribly written Python script to do that, so unless Ian or someone else comes up with the answer sooner, give me some minutes. – derpy Oct 23 '15 at 12:50
  • 2
    Wasn't the $20^{\text{th}}$ century 1901-2000? – Julián Aguirre Oct 23 '15 at 14:57
  • @JuliànAguirre no. For the same reason we celebrated a new millennium when we hit 2000. The third millennium began so the second millennium was from 1000-1999 – Ivo Oct 23 '15 at 22:38
  • 2
    @IvoBeckers Not according to Wikipedia. When did the first century begin? – Julián Aguirre Oct 24 '15 at 05:48
0

Here is some very simple R code if anyone wants to run the various possible permutations of this query:

library(lubridate)
library(gmp)
dates = seq(as.Date("1900-01-01"),as.Date("1999-12-31"),1)
prime1 = isprime(as.numeric(strftime(dates,"%d%m%Y")))
table(prime1)