# How can I count the number of days (Monday, Tues, etc) in a year?

I am new to Mathematica and for fun am trying some of the challenges. The one I am working on now is:

Write a function MostOccurringWeekday that takes an integer representing a year as input and returns a list of the most-occurring weekdays throughout that year.


I'm not sure where to start? I assume I'll have to do a loop from 1/1/[YEAR] to 12/31/[YEAR] and count each weekday.

This is my attempt at getting a date:

year = 1998
Interpreter["Date"][StringForm["1/1/", year]]


But this results in an error.

If anyone could give some pointers, I'd greatly appreciate it.

Thanks

• Lookup DayCount – Carl Woll Apr 25 at 14:48
• I assume I'll have to do a loop from .... Whoaaa, slow down there. In a 365-day year there are 53 occurrences of the day on which the year starts, 52 occurrences of each of the other days. Try something like DateString[{2018}, "DayName"] and work the rest out. – High Performance Mark Apr 25 at 16:34