How often in years do calendars repeat with the same day-date combinations (Julian calendar)? E.g. I'm using this formulas for calculating day of week (Julian calendar):

\begin{align}
a & = \left\lfloor\frac{14 - \text{month}}{12}\right\rfloor\\
y & = \text{year} + 4800 - a \\
m & = \text{month} + 12a - 3
\end{align}



\begin{align}
J\!D\!N = 
(\text{day} + 
\left\lfloor\frac{153m+2}{5}\right\rfloor +
365y+
\left\lfloor\frac{y}{4}\right\rfloor -
\left\lfloor\frac{y}{100}\right\rfloor +
\left\lfloor\frac{y}{400}\right\rfloor -
32045)\text{mod}\text{7}
\end{align}


And I know that in Julian calendar, leap year is a year which:


\begin{align}
\text{year}\:mod\:4=0
\end{align}



Using simple python program, I can solve this problem very fast. And answer (if we starting for leap year) is 28 year cycle.
But how to correctly prove this hypothesis, using only math equations? Is it possible?

2003 and 2020 are NOT identical, 2020 is a leap year whereas 2003 is not, 2003 repeats in 2014,2025,2031 and 2042.
