February 13, 1976 was an interesting date. The product of the month, day, and 2-digit year is equal to the 4-digit year:
2*13*76=1976.
Find all dates in the 20th and 21st centuries with this property.
d=datetime(1900,1,1);
d.Format='yyyy/MMM/dd';
while d<=datetime(2099,12,31)
ymd=(datevec(d));
ymd=ymd(1:3);
if ymd(2)*ymd(3)*mod(ymd(1),100)==ymd(1)
disp(d)
end
d=d+1;
end
finds
>> productInCalendar
1920/Apr/24
1920/Jun/16
1920/Aug/12
1920/Dec/08
1925/Jul/11
1925/Nov/07
1938/Mar/17
1950/Mar/13
1976/Jan/26
1976/Feb/13
1995/Jan/21
1995/Mar/07
1995/Jul/03
2016/Jun/21
2016/Jul/18
2016/Sep/14
2025/Mar/27
2025/Sep/09
2040/Mar/17
2080/Jan/26
2080/Feb/13
>>
Note: 2100 excluded because the product would be zero -- but it is part of the 21st century.
|
Posted by Charlie
on 2024-05-27 09:38:50 |