23May/11Off
Answers to “Nerdy fun with dates and primes”
Answers to the questions in "Nerdy fun with dates and primes":
- What was the last date to be a prime number in both notations?
2010-08-09, which translates to 20100809 and 2010221
(the only such date in 2010) - What will be the next date that is a prime number in both notations?
2012-03-23, which translates to 20120323 and 2012083
(the only such date in 2012) - What is the most recent past year with more than one date which is prime in both notations?
2008 had 3 such dates: 2008-01-03, 2008-10-03, and 2008-10-23. - What is the nearest future year with more than one date which is prime in both notations?
2013 will have 3 such dates: 2013-08-29, 2013-11-03, and 2013-11-09
7May/11Off
Nerdy fun with dates and primes – Updated
Programmers have a couple of common methods of turning dates into integers for ease of sorting and comparison. Using my own terminology, let's call these YMD-notation (for Year-Month-Day) and YJ-notation (for Year-Julian date).
- YMD-notation
- yyyymmdd -- the four-digit year, followed by the two-digit month, then the two-digit day of the month, using leading zeros where necessary. Thus, 3/17/2009 would be the number 20090317 -- the 17th day of the third month of the year 2009.
- YJ-notation
- yyyyjjj -- the four-digit year, followed by the three-digit day of the year, again using leading zeros. Thus, 1/2/2001 would be 2009002 -- the second day of the year 2009; 2/1/1998 would be 1998032 -- the 32nd day of the year 1998.
Obviously, when you turn a date into an integer, it might be prime. The following dates in 2011 are prime in one notation or the other:
| Date | YMD-notation | Prime in YMD-notation? | YJ-notation | Prime in YJ-notation? |
|---|---|---|---|---|
| 2011-01-03 | 20110103 | 2011003 | Yes | |
| 2011-01-09 | 20110109 | Yes | 2011009 | |
| 2011-01-19 | 20110119 | 2011019 | Yes | |
| 2011-01-21 | 20110121 | 2011021 | Yes | |
| 2011-01-27 | 20110127 | 2011027 | Yes | |
| 2011-02-02 | 20110202 | 2011033 | Yes | |
| 2011-02-17 | 20110217 | Yes | 2011048 | |
| 2011-02-26 | 20110226 | 2011057 | Yes | |
| 2011-03-01 | 20110301 | Yes | 2011060 | |
| 2011-03-10 | 20110310 | 2011069 | Yes | |
| 2011-03-14 | 20110314 | 2011073 | Yes | |
| 2011-03-22 | 20110322 | 2011081 | Yes | |
| 2011-04-09 | 20110409 | 2011099 | Yes | |
| 2011-04-11 | 20110411 | Yes | 2011101 | |
| 2011-04-21 | 20110421 | 2011111 | Yes | |
| 2011-04-29 | 20110429 | Yes | 2011119 | |
| 2011-05-03 | 20110503 | 2011123 | Yes | |
| 2011-05-07 | 20110507 | 2011127 | Yes | |
| 2011-05-09 | 20110509 | 2011129 | Yes | |
| 2011-05-11 | 20110511 | Yes | 2011131 | |
| 2011-05-13 | 20110513 | Yes | 2011133 | |
| 2011-05-23 | 20110523 | Yes | 2011143 | |
| 2011-05-27 | 20110527 | 2011147 | Yes | |
| 2011-06-03 | 20110603 | Yes | 2011154 | |
| 2011-06-13 | 20110613 | Yes | 2011164 | |
| 2011-06-19 | 20110619 | Yes | 2011170 | |
| 2011-06-20 | 20110620 | 2011171 | Yes | |
| 2011-07-02 | 20110702 | 2011183 | Yes | |
| 2011-07-12 | 20110712 | 2011193 | Yes | |
| 2011-07-18 | 20110718 | 2011199 | Yes | |
| 2011-07-20 | 20110720 | 2011201 | Yes | |
| 2011-07-30 | 20110730 | 2011211 | Yes | |
| 2011-08-01 | 20110801 | Yes | 2011213 | |
| 2011-08-07 | 20110807 | Yes | 2011219 | |
| 2011-08-19 | 20110819 | Yes | 2011231 | |
| 2011-08-23 | 20110823 | Yes | 2011235 | |
| 2011-08-29 | 20110829 | 2011241 | Yes | |
| 2011-09-16 | 20110916 | 2011259 | Yes | |
| 2011-09-24 | 20110924 | 2011267 | Yes | |
| 2011-09-27 | 20110927 | Yes | 2011270 | |
| 2011-10-04 | 20111004 | 2011277 | Yes | |
| 2011-10-11 | 20111011 | Yes | 2011284 | |
| 2011-10-18 | 20111018 | 2011291 | Yes | |
| 2011-10-23 | 20111023 | Yes | 2011296 | |
| 2011-10-27 | 20111027 | Yes | 2011300 | |
| 2011-11-05 | 20111105 | 2011309 | Yes | |
| 2011-11-29 | 20111129 | 2011333 | Yes | |
| 2011-12-13 | 20111213 | Yes | 2011347 | |
| 2011-12-29 | 20111229 | 2011363 | Yes |
You might notice that no date in 2011 is prime in both YMD-notation and YJ-notation. That gives rise to the following questions.
- What was the last date to be a prime number in both notations?
- What will be the next date that is a prime number in both notations?
- What is the most recent past year with more than one date which is prime in both notations?
- What is the nearest future year with more than one date which is prime in both notations?
Answers in a later post! Update: Answers have been posted.
6May/11Off
Prime trivia
The following are all prime numbers:
31
331
3331
33331
333331
3333331
33333331
