I was recently given the following problem on a test:
Find the dates on which Sunday fell in July, $1776$.
First, I noted the date on the day of test — $15$ October $2023$ to be a Sunday. Thereafter, I used the observation that the days were periodic with period $7$, meaning that after every seven dates, the same day is observed.
Using this, I found out that on $1$ October $2023$ was a Sunday, then used this for the previous few months to find that $2$ July $2023$ was a Sunday. Then I counted that there lied $59$ leap years and $187$ regular solar years between $1776$ and $2023$. Before and inclduing $2$ July $2023$ were $183$ days of the year $2023$. After the month of July were $153$ days in $1776$. Suppose that on $x$ July, $1776$ a Sunday was seen, thus yielding the equation:
$$59 + 365\cdot 246 + 183 + 153 + (31-x)\equiv 0 \pmod 7$$ $$x \equiv 0 \pmod 7$$ which should mean that the $7, \ 14, \ 21, \ 28$th of July $1776$ were Sundays.
However, I wonder if there exists a simple closed form expression that can be used to calculate the same. Is there some other alternative way to find this? I'm pretty sure that such calculations have been extensively studied and there exists one.
Help and insights are appreciated.