10
$\begingroup$

The day of the month, and the month of the year, often simultaneously divide the year. Most recently it happened on January 3, 2019 because both 1 (January) and 3 divide 2019.

In our era, since 1/1/1, which years have had the most such dates?

$\endgroup$
  • $\begingroup$ For clarification: Is a divisible date one in which either the day or month divide the year, or one in with both do? $\endgroup$ – Van Jan 25 at 15:11
  • $\begingroup$ @Van Yes, both. $\endgroup$ – Bernardo Recamán Santos Jan 25 at 15:16
  • $\begingroup$ can we solve this with some code? :) $\endgroup$ – Flying_whale Jan 25 at 15:17
  • $\begingroup$ @Flying_whale: Go! $\endgroup$ – Bernardo Recamán Santos Jan 25 at 15:18
11
$\begingroup$

I'm going to go with

1680

factors:

1,2,3,4,5,6,7,8,10,12,14,15,16,20,21,24,28,30

So it hits on

179 days (10 months times 18 days, minus 30th of February)

Method:

Looked up

Highly composite numbers, picked the largest that's smaller than 2019.

$\endgroup$
  • $\begingroup$ Van got more days then this, so shouldn’t his be the accepted answer? $\endgroup$ – tyobrien Jan 26 at 1:58
  • $\begingroup$ @tyobrien If you look at the bottom right hand corner of the answer, you'll notice that this isn't the JonMark Perry answer Van managed to beat. :-) $\endgroup$ – Bass Jan 26 at 2:25
6
$\begingroup$

I found

with a bit of code i found 1680 with 179 dates you can run it here : https://rextester.com/YITA38880

$\endgroup$
5
$\begingroup$

I believe I can beat JonMark Perry's answer:

1260 = 2 x2 x3 x3 x5 x7
For months, I can get 1, 2, 3, 4, 5, 6, 7, 9, 10, & 12 (10 - same).
But for days, I get:
1, 2, 3, 4, 5, 6, 7, 9, 10, 12 & 14, 15, 18, 20, 21, 28, 30 (17 - one more than Jon)

$\endgroup$
4
$\begingroup$

I'd be surprised if you can beat:

1080. It equals $2^3\times3^3\times5$, and so covers $1,2,3,4,5,6,8,9,10,12,15,18,20,24,27,30$ for days and $1,2,3,4,5,6,8,9,10,12$ for months.

$\endgroup$
4
$\begingroup$

This is a small enough set that a very simple program should be able to just brute-force it in a fraction of a second. So, here's a Python version. And, just to verify it, here's a wildly different one).1

If you run either one, the winner is:

1680, with 179 divisible days.

This makes perfect sense, for the reason Bass explains, but the brute-forcing shows how you could get the answer even without thinking very far.

That record obviously won't stand forever,2 but how soon will the record be broken?

Just change the outer loop to for year in itertools.count(1): to keep scanning until the end of time,3 and you'll see that:

2520 will have 208 divisible days.


1. Depending on the Python version, the datetime type may assume proleptic Georgian, so it'll incorrectly treat 400, 800, and 1200 as leap years. None of those three years is divisible by 29, so it won't make a difference. But better to actually get the rule right, as in the first version, than to get it wrong and then explain why it doesn't matter, right?

2. 2329089562800 is a leap year divisible by every number up to 31, so, assuming we use the Gregorian calendar that long, it will have 366 divisible dates.

3. Going all the way to 2329089562800 without optimizing the algorithm would probably take a while, but you can hit ^C after you get the first post-2019 record, or after you've seen enough that you're bored.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.