You're reading: Travels in a Mathematical World

Spooky 007 date coincidence

Image: 007.com

John Bibby points out a numeric coincidence – “Sean Connery died on 31/10/20. If you add up all the numbers in the date = 007”. Spooky, huh? I’m hoping you’re asking ‘is that unlikely?’ John asks “How many other dates this year add up to 007? What about in 2021?”

https://twitter.com/aa42john/status/1324405199419674624

This is a fine pen-and-paper activity (or for thinking about in the shower, as I tried this morning), but also a nice little brute-force coding exercise.

I wrote some code which calculates the digit sum for days in a year from a start date you give it (e.g. 1st January 2020) and outputs:

  • a list of dates in the year and their digit sums;
  • a list of digit sums and how many dates in the year have this digit sum;
  • a bar chart of the digit sums and how many dates in the year have this digit sum.

Given what I’ve said the program does, beware that there are spoilers below. I’d encourage you to have a go, either on paper or in code, before reading on.

Note: the maximum value for the digit sum of a two-digit year is 99. The maximum value for the digit sum of a day is 29. The maximum value for the digit sum of a month is September, 9. Therefore, the maximum digit sum in this form is \(9+9+0+9+2+9=38\).

Anyway, some answers. There are 23 dates with digit sum 7 in 2020 and 18 dates with digit sum 7 in 2021.

My program answers the question more generally than that, though. Charts of the digit sum frequencies for 2020 and 2021 are below.

Bar chart showing counts of digit sums for 2020-01-01 to 2020-12-31. Digit sums range from 4 to 22, with more dates matching the dates up to 12 and 13, which are joint maximum, than higher numbers.
Bar chart showing counts of digit sums for 2021-01-01 to 2021-12-31. Digit sums range from 5 to 23, with more dates matching the dates up to 13 and 14, which are joint maximum, than higher numbers. The chart is quite similar to the previous one, though with digit sums shifted one number higher.

More information

Python code: date_coincidence_checker on GitHub.

2 Responses to “Spooky 007 date coincidence”

  1. Avatar John

    The digit sum is only half the story. We need 007, not 7, and that means two zeros. If we require the date to contain two zeros, the number drops to eight in 2020 and only one in 2021.

    Reply

(will not be published)

$\LaTeX$: You can use LaTeX in your comments. e.g. $ e^{\pi i} $ for inline maths; \[ e^{\pi i} \] for display-mode (on its own line) maths.

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>