[Math] Equation Calculating what Day it is

algebra-precalculusmodular arithmetic

Consider this word problem:

If the first day of the year is a Monday, what is the 260th day? Answer: Monday

Why does this equation work to calculate what day of the week it is:

260 = (7w + 1) [w stands for week]

How does it work and how would you even develop this equation to get the answer?

I understand that if you divide 260 by 7 you get 37.1 . Meaning all the days fit into weeks excluding one day; the first day of the week.. Monday.

But what if the first day of the year is Wednesday. What would you do then ?

Thanks!!

Best Answer

Use modular arithmetic. Let's say the first day of the year is day $x$, which takes a value from $0$ to $6$, with and $0 \equiv \text{ Monday}$, so that $x$ is the number of days after the start of the first week that the transition to the new year occurs.

Now, to find what day of the week the $y$th day of the year will be, note that $y-1$ days have passed between the $1$st an $y$th day, so add on an extra $y-1$ days to whatever the first day was ($x$). $$(y-1)+x \mod 7$$ where $... \mod 7$ is the remainder left over when you take away $7$ the maximum number of times from $...$ (that still leaves a positive integer).

In the first case, $x= \text{ Monday }=0$ and $y=260$, so $$(260-1)+0 \mod 7 \equiv 259-7-7-7-... \mod 7 $$$$259-7(w) \mod 7$$$$\equiv 0 \mod 7$$ Which is Monday

If Wednesday is the first day, then let $x=2$, so the $260$th day is $$(260-1)+2 \mod 7 \equiv 2 \mod 7$$

Edit: the answer with less modular arithmetic.

If the $1$st day is Monday, then the $8$th, $15$th, $22$nd... days will also be Monday. These numbers have the general form $7w+1$.

If the $1$st day is Monday, then the $2$nd, $9$th, $16$th, $23$rd... days will be Tuesday. These numbers have the general form $7w+2$.

The $3$rd, $10$th, $17$th, $24$th... days will be Wednesday. These numbers have the general form $7w+3$.

In general, why do Mondays have the form $7w+1$? Day $1$ is a Monday, and any day a multiple of $7$ up from that will also be a Monday (or, will $\equiv 1 \mod 7$). So you can add $7$ to $1$ as many times as you want without affecting the resulting number's Mondayness.

If the first day is a Wednesday, all days that year will be shifted down $2$ from the Monday situation. Thus Monday has the form $(7w+1)-2=7w-1=7w+6$, Tuesday $7w$, W. $7w+1$, Th. $7w+2$, F. $7w+3$, Sa. $7w+4$, and Sunday $7w+5$.

Related Question