%p12S.tex: 
%begin macros
\baselineskip=14pt
\parskip=10pt
\magnification=\magstephalf
\parindent=0pt
\overfullrule=0in
\def\frac#1#2{{#1 \over #2}}
\def\g{\bigtriangledown}
\def\S{\cal S}
\nopagenumbers
%end macros
 

\centerline
{
\bf Solutions to Attendance Quiz \# 12 for Dr. Z.'s Number Theory
Course for Oct. 17, 2013
}
\bigskip

{\bf 1.} Using divisiblity tests, determine
which of the following 
integers (written in the usual, base $10$, way)
is divisible by (i) $9$ (ii)$11$ (iii)$7$.

{\bf a.} $683444$

{\bf b.} $17888$

{\bf c.} $139135$

{\bf Sol. of 1}:

{\bf a} 

(i) $6+8+3+4+4+4 \pmod{9} =2$ so it {\bf not} divisible by $9$

(ii) $6-8+3-4+4-4 \pmod{11}=8$ so it is {\bf not} divisible by $11$

(iii) $684-444 \pmod{7}=240 \pmod{7}=2$ so it is {\bf not} divisible by $7$



{\bf b.}


(i) $1+7+8+8+8 \pmod{9} =5$ so it {\bf not} divisible by $9$

(ii) $1-7+8-8+8 \pmod{11}=2$ so it is {\bf not} divisible by $11$

(iii) $888-17 \pmod{7}=871 \pmod{7}=3$ so it is {\bf not} divisible by $7$

{\bf c} 

(i) $1+3+9+1+3+5 \pmod{9} =4$ so it {\bf not} divisible by $9$

(ii) $1-3+9-1+3-5 \pmod{11}=4$ so it is {\bf not} divisible by $11$

(iii) $139-135 \pmod{7}=4 \pmod{7}$ so it is {\bf not} divisible by $7$



{\bf 2.} Using the Perpetual calendar algorithm, find out
on what day of the week is going to be  Oct. 17, 5000.

{\bf Hint}: Find out how many leap years will be from now until 5000.


{\bf Sol. of 2.}: 

(i) The number  of years until Oct. 17, 2013 is $5000-2013=2987$

(ii) The number of leap years, ignoring the excepctions and the exceptions to the exceptions is $\lfloor (5000-2012)/4 \rfloor=747$, 

(iii) The number of multiples of $100$, starting at $2013$ until $5000$ (including $5000$) is $50-20=30$

(iv) The number of multiples of $400$ until $5000$, starting with $2400$ is 
$\lfloor (5000-2000)/400 \rfloor= \lfloor 30/4 \rfloor=7$.

So the total number of leap years (extra days) is:
$$
747-30+7
$$
And the total number of days that elapsed, mod $7$ is
$$
2987 + 747 -30 +7 \pmod{7} = 5+5-2+0 \pmod{7}=1
$$

But {\bf today}, Oct. 17, 2013, is {\bf Thursday}, i.e. Day $5$. So Oct. 17, 5000 is going to be Day $5+1=6$, in other words, a Friday.

{\bf Ans. to 2}: Oct. 17, 5000 will fall on a Friday.


\end





