Bithday products

Recently we talked about birthdays with a special feature in the number of year-mont-date and I was asked about the number of dates with the property that the product of the day and the month yields the year. Assuming that the format of dates is yy.mm.dd this problem can be solved with the help of Mathematica quite easily. Let us call this special dates product birthdays. So for example the combination {12, 4, 3} , representing the third of April in 2012 is possible since 3*4=12. But the combination {12, 4, 27} is not, in none of the possible years, because the product from month and day yields 108.

Check for the current year

The current year is 2016 and so we take a quick look at the different possibilities we have for such product birthdays in this year.With help of the functions DateRange we construct all dates of this year and then filter out the desired ones. For 2016 these are four: {{16, 1, 16}, {16, 2, 8}, {16, 4, 4}, {16, 8, 2}}. So have the desired results in January, February, April and August. This is clear because in this year the last two digits of the year are a power of two (16). The code is shown here at the right side of the page.

In the first step we generate a list of all possible dates:A quick check shows that everything seems to be o.k.In the next step we transform the year to the appropriate format:As a last step we filter out all dates that fulfill the condition:Surprise surprise, this is only a few dates, what is in fact not too surprising since for this year the year-Part is the power of a single prime (2).Now we can easily collect this steps to a single one:Now

Check for an arbitraray year

The generalisation to an arbitrary year is now quite straightforward:

Now it is easy to determine all possible combinations. It is just one line of code:

We have in total 212 possibilities for such birthday products. The maximum of seven sch dates is in years wich end with 24. An there are 20 years where none of such combinations occur: {37, 41, 43, 47, 53, 58, 59, 61, 62, 67, 71, 73, 74, 79, 82, 83, 86, 89, 94, 97}