% If you are working from this template to just write up your own
% solutions, I'm trying to keep it simple for you and there are only a
% few places you need to edit. On line 43 there's a place where the
% phrase "YOUR NAME HERE" appears; change it to your actual
% name. Several places below there are places where the phrase "YOUR
% ANSWER HERE" appears, and directly below (or replacing) those lines
% are good places to put your answers.
%
% One important thing you need to do, however (due to the complicated
% way I use a single form to automatically produce both the question
% sheets and solution writeups) is to make sure that you keep the word
% 'solution' in your filename, or else your answers won't be printed
% at all.
\documentclass[12pt]{article}

\usepackage[margin=0.7in,dvips]{geometry}
\usepackage{fancyhdr,lastpage}
\usepackage{amsmath,amsfonts,amsthm}
\usepackage{tikz}
\usepackage{substr}

\IfSubStringInString{\detokenize{solution}}{\jobname}{%
  % Solutions
  \newcommand\qfill{}
  \newcommand\qpage{}
  \newcommand\qonly[1]{}
  \newcommand\answer[1]{#1}
  \newcommand\question[1]{{\em #1}}
  \newcommand\rubric[1]{}
}
{%
  % Question sheets
  \newcommand\qfill{\vfill}
  \newcommand\qpage{\newpage}
  \newcommand\qonly[1]{#1}
  \newcommand\answer[1]{}
  \newcommand\question[1]{#1}
  \newcommand\rubric[1]{}
}

\pagestyle{fancy}
\lhead{MATH 311-02}
\chead{Problem Set \#2\answer{ solutions}}
\rhead{\answer{YOUR NAME HERE}}
\lfoot{}
\cfoot{Page \thepage\ of \pageref{LastPage}}
\rfoot{{\bf due February 16, 2018}}

\begin{document}
Prove the following statements.
\begin{enumerate}
\item \question{No perfect square has a last digit of $7$.}

  \answer{}

\item \question{For all integers $m$ and $n$,
    $4\mid(m^2-n^2)$ if and only if $m$ and $n$ have the same parity
    (i.e. both even or both odd).}

  \answer{}

\item \question{For any real numbers $x$ and $y$,
    $\bigl||x|-|y|\bigr|\leq|x-y|$.}

  \answer{}

\item \question{For any natural number $n$,
    $1+4+7+\cdots+(3n-2)=\frac{n(3n-1)}2$.}

  \answer{}

\end{enumerate}

\end{document}
