% LaTeX solution template for Math 235
% -----------------------------------------------------------------

% Like most advanced LaTeX files, this one begins with a lot of
% boilerplate. You don't need to understand (or even read) most of it.
% All you need to do is fill in your name, email address,
% and the number of the pset. (Search for "METADATA" to find the place
% for this.) Then, you can go straight to the "EXERCISE 1"
% section and start writing your solutions.
% The "VARIOUS USEFUL COMMANDS" section is probably worth taking a
% look at at some point.

% If you are here to learn about LaTeX, search for
% "START READING HERE" and start reading there.

%----------------------------------------------------------------------------------------
%	PACKAGES AND OTHER DOCUMENT CONFIGURATIONS
%----------------------------------------------------------------------------------------
\documentclass[paper=a4, fontsize=12pt]{scrartcl} % A4 paper and 12pt font size
\usepackage[T1]{fontenc} % Use 8-bit encoding that has 256 glyphs
\usepackage[english]{babel} % English language/hyphenation
\usepackage{amsmath,amsfonts,amsthm,amssymb} % Math packages
\usepackage{mathrsfs}    % More math packages
\usepackage{sectsty}  % Allows customizing section commands
\allsectionsfont{\centering \normalfont\scshape} % Make all section titles centered, the default font and small caps %remove this to left align section tites
\usepackage{hyperref} % Turns cross-references into hyperlinks,
                      % and defines \url and \href commands.
\usepackage{graphicx} % For embedding graphics files.
\usepackage{framed}   % For the "leftbar" environment used below.
\usepackage{ifthen}   % Used for the \powset command below.
\usepackage{lastpage} % for counting the number of pages
\usepackage[headsepline,footsepline,manualmark]{scrlayer-scrpage}
\usepackage[height=10in,a4paper,hmargin={1in,0.8in}]{geometry}
\usepackage[usenames,dvipsnames]{xcolor}
\usepackage{tikz}     % This is a powerful tool to draw vector
                      % graphics inside LaTeX. In particular, you can
                      % use it to draw graphs.
\usepackage{verbatim} % For the "verbatim" environment, in which
                      % special symbols can be used freely without
                      % confusing the compiler. (And it's typeset in
                      % a constant-width font.)
                      % Useful, e.g., for quoting code (or ASCII art).

%\numberwithin{table}{section} % Number tables within sections (i.e. 1.1, 1.2, 2.1, 2.2 instead of 1, 2, 3, 4)

\setlength\parindent{20pt} % Makes indentation for paragraphs longer.
                           % This makes paragraphs stand out more.

%----------------------------------------------------------------------------------------
%	VARIOUS USEFUL COMMANDS
%----------------------------------------------------------------------------------------
% The commands below might be convenient. For example, you probably
% prefer to write $\powset[2]{V}$ for the set of $2$-element subsets
% of $V$, rather than writing $\mathcal{P}_2(V)$.
% Notice that you can easily define your own commands like this.
% Caveat: Some of these commands need to be properly "guarded" when
% they occur in subscripts or superscripts. So you should not write
% $K_\CC$, but rather $K_{\CC}$.
\newcommand{\CC}{\mathbb{C}} % complex numbers
\newcommand{\RR}{\mathbb{R}} % real numbers
\newcommand{\QQ}{\mathbb{Q}} % rational numbers
\newcommand{\NN}{\mathbb{N}} % nonnegative integers
\newcommand{\Z}[1]{\mathbb{Z}/#1\mathbb{Z}} % integers modulo k
                                            % (syntax: "\Z{k}")
\newcommand{\ZZ}{\mathbb{Z}} % integers
\newcommand{\id}{\operatorname{id}} % identity map
\newcommand{\lcm}{\operatorname{lcm}}
% Lowest common multiple. For historical reasons, LaTeX has a \gcd
% command built in, but not an \lcm command. The preceding line
% rectifies that.
\newcommand{\rev}{\operatorname{rev}} % reversal of a walk
\newcommand{\powset}[2][]{\ifthenelse{\equal{#2}{}}{\mathcal{P}\left(#1\right)}{\mathcal{P}_{#1}\left(#2\right)}}
% $\powset[k]{S}$ stands for the set of all $k$-element subsets of
% $S$. The argument $k$ is optional, and if not provided, the result
% is the whole powerset of $S$.
\newcommand{\set}[1]{\left\{ #1 \right\}}
% $\set{...}$ compiles to {...} (set-brackets).
\newcommand{\abs}[1]{\left| #1 \right|}
% $\abs{...}$ compiles to |...| (absolute value, or size of a set).
\newcommand{\tup}[1]{\left( #1 \right)}
% $\tup{...}$ compiles to (...) (parentheses, or tuple-brackets).
\newcommand{\ive}[1]{\left[ #1 \right]}
% $\ive{...}$ compiles to [...] (Iverson bracket, aka truth value).
\newcommand{\floor}[1]{\left\lfloor #1 \right\rfloor}
% $\floor{...}$ compiles to |_..._| (floor function).
\newcommand{\verts}[1]{\operatorname{V}\left( #1 \right)}
% $\verts{...}$ compiles to V(...) (vertex set of a graph/digraph).
\newcommand{\edges}[1]{\operatorname{E}\left( #1 \right)}
% $\edges{...}$ compiles to E(...) (edge set of a graph).
\newcommand{\arcs}[1]{\operatorname{A}\left( #1 \right)}
% $\arcs{...}$ compiles to A(...) (arc set of a digraph).
\newcommand{\lf}[2]{#1^{\underline{#2}}}
% $\lf{...1}{...2}$ compiles to $...1^{\underline{...2}}$.
% This is a notation for the falling factorial.
\newcommand{\underbrack}[2]{\underbrace{#1}_{\substack{#2}}}
% $\underbrack{...1}{...2}$ yields
% $\underbrace{...1}_{\substack{...2}}$. This is useful for doing
% local rewriting transformations on mathematical expressions with
% justifications. For example, try this out:
% $ \underbrack{(a+b)^2}{= a^2 + 2ab + b^2 \\ \text{(by the binomial formula)}} $
\newcommand{\horrule}[1]{\rule{\linewidth}{#1}} % Create horizontal rule command with 1 argument of height
\newcommand{\nnn}{\nonumber\\} % Don't number this line in an "align" environment, and move on to the next line.
\newcommand{\explain}[1]{\tup{\hspace{-0.5pc}\text{\begin{tabular}{c}#1\end{tabular}\hspace{-0.5pc}}}}
% $\explain{...}$ interprets the "..." as text (you can
% nest some math inside by putting it in $...$'s as you
% would in any other text block) and puts it in parentheses.

%----------------------------------------------------------------------------------------
%	MAKING SUMMATION SIGNS ALWAYS PUT THEIR BOUNDS ABOVE AND BELOW
%	THE SIGN
%----------------------------------------------------------------------------------------
% The following are hacks to ensure that sums (such as
% $\sum_{k=1}^n k$) always put their bounds (i.e., the $k=1$ and the
% $n$) underneath and above the sign, as opposed to on its right.
% Same for products (\prod), set unions (\bigcup) and set
% intersections (\bigcap). Remove the 8 lines below if you do not want
% this behavior.
\let\sumnonlimits\sum
\let\prodnonlimits\prod
\let\cupnonlimits\bigcup
\let\capnonlimits\bigcap
\renewcommand{\sum}{\sumnonlimits\limits}
\renewcommand{\prod}{\prodnonlimits\limits}
\renewcommand{\bigcup}{\cupnonlimits\limits}
\renewcommand{\bigcap}{\capnonlimits\limits}

%----------------------------------------------------------------------------------------
%	ENVIRONMENTS
%----------------------------------------------------------------------------------------
% The incantations below define how theorem environments
% (\begin{theorem} ... \end{theorem}) and their likes will look like.
\newtheoremstyle{plainsl}% <name>
  {8pt plus 2pt minus 4pt}% <Space above>
  {8pt plus 2pt minus 4pt}% <Space below>
  {\slshape}% <Body font>
  {0pt}% <Indent amount>
  {\bfseries}% <Theorem head font>
  {.}% <Punctuation after theorem head>
  {5pt plus 1pt minus 1pt}% <Space after theorem headi>
  {}% <Theorem head spec (can be left empty, meaning `normal')>

% Environments which make the text inside them slanted:
\theoremstyle{plainsl}
  \newtheorem{theorem}{Theorem}[section]
  \newtheorem{proposition}[theorem]{Proposition}
  \newtheorem{lemma}[theorem]{Lemma}
  \newtheorem{corollary}[theorem]{Corollary}
  \newtheorem{conjecture}[theorem]{Conjecture}
% Environments that don't:
\theoremstyle{definition}
  \newtheorem{definition}[theorem]{Definition}
  \newtheorem{example}[theorem]{Example}
  \newtheorem{exercise}[theorem]{Exercise}
  \newtheorem{examples}[theorem]{Examples}
  \newtheorem{algorithm}[theorem]{Algorithm}
  \newtheorem{question}[theorem]{Question}
 \theoremstyle{remark}
  \newtheorem{remark}[theorem]{Remark}
\newenvironment{statement}{\begin{quote}}{\end{quote}}
\newenvironment{fineprint}{\begin{small}}{\end{small}}

%----------------------------------------------------------------------------------------
%	METADATA
%----------------------------------------------------------------------------------------
\newcommand{\myname}{Darij Grinberg} % ENTER YOUR NAME HERE
\newcommand{\mymail}{darij.grinberg@drexel.edu} % ENTER YOUR EMAIL HERE
\newcommand{\psetnumber}{1} % ENTER THE NUMBER OF THIS PSET HERE

%----------------------------------------------------------------------------------------
%	HEADER AND FOOTER
%----------------------------------------------------------------------------------------
\ihead{Solutions to homework set \#\psetnumber} % Page header left
\ohead{page \thepage\ of \pageref{LastPage}} % Page header right
\ifoot{\myname} % left footer
\ofoot{\mymail} % right footer

%----------------------------------------------------------------------------------------
%	TITLE SECTION
%----------------------------------------------------------------------------------------
\title{	
\normalfont \normalsize 
\textsc{Drexel University, Department of Mathematics} \\ [25pt] % Your university, school and/or department name(s)
\horrule{0.5pt} \\[0.4cm] % Thin top horizontal rule
\huge Math 235: Mathematical Problem Solving, \\
Fall 2020:
Homework \psetnumber\\% The assignment title
\horrule{2pt} \\[0.5cm] % Thick bottom horizontal rule
}
\author{\myname}

\begin{document}

\maketitle % This command causes the title part to be printed.

%----------------------------------------------------------------------------------------
%	EXERCISE 1
%----------------------------------------------------------------------------------------
\horrule{0.3pt} \\[0.4cm]

\section{Exercise 1}

\subsection{Problem}

Let $k$ be a positive integer.
A set $S$ of integers is said to be \emph{$k$-lacunar}
if every two distinct elements $u, v \in S$
satisfy $\abs{u-v} > k$.
(Thus, a $1$-lacunar set is the same as a lacunar set as
defined in the notes.)

Let $n \in \NN$.
Let $S$ be a $k$-lacunar subset of $\set{1, 2, \ldots, n}$.
Prove that
\[
\abs{S} \leq \dfrac{n + k - 1}{k}.
\]

(Thus, in particular, if $S$ is a lacunar subset of
$\set{1, 2, \ldots, n}$, then $\abs{S} \leq \dfrac{n + 1}{2}$.)

\subsection{Solution}

...

%----------------------------------------------------------------------------------------
%	EXERCISE 2
%----------------------------------------------------------------------------------------
\horrule{0.3pt} \\[0.4cm]

\section{Exercise 2}

\subsection{Problem}

Let $\tup{f_0, f_1, f_2, \ldots}$ be the Fibonacci sequence.
Prove that any $n, m \in \NN$ satisfy
\[
\gcd \tup{f_n, f_m} = f_{\gcd\tup{n,m}} .
\]

\subsection{Solution}

...

%----------------------------------------------------------------------------------------
%	EXERCISE 3
%----------------------------------------------------------------------------------------
\horrule{0.3pt} \\[0.4cm]

\section{Exercise 3}

\subsection{Problem}

Let $\tup{F_0, F_1, F_2, \ldots}$ be the
\emph{Fermat sequence} -- that is, the
sequence of integers defined by
\[
F_n = 2^{2^n} + 1 \qquad \text{for each $n \in \NN$}.
\]
(Keep in mind that nested powers are to be read top-to-bottom:
That is, the expression ``$a^{b^c}$'' means
$a^{\tup{b^c}}$ rather than $\tup{a^b}^c$.)

\begin{enumerate}

\item[\textbf{(a)}] Prove that
\[
F_n = F_0 F_1 \cdots F_{n-1} + 2
\qquad \text{for every integer $n > 0$.}
\]

\item[\textbf{(b)}]
Prove that $\gcd \tup{F_n, F_m} = 1$ for any two
distinct positive integers $n$ and $m$.

\end{enumerate}

\subsection{Solution}

...

%----------------------------------------------------------------------------------------
%	EXERCISE 4
%----------------------------------------------------------------------------------------
\horrule{0.3pt} \\[0.4cm]

\section{Exercise 4}

\subsection{Problem}

Prove that there exist \textbf{infinitely many}
\textbf{odd} positive integers $n$ for which
\[
\dfrac{1! \cdot 2! \cdot \cdots \cdot \tup{2n}!}{\tup{n+1}!}
\text{ is a perfect square.}
\]

\subsection{Solution}

...

%----------------------------------------------------------------------------------------
%	EXERCISE 5
%----------------------------------------------------------------------------------------
\horrule{0.3pt} \\[0.4cm]

\section{Exercise 5}

\subsection{Problem}

Let $x \in \RR$. Let $n$ and $m$ be positive integers.
Prove that
\[
\sum_{k=0}^{mn-1} \floor{x + \dfrac{k}{n}}
= m \tup{ \floor{nx} + \dfrac{n \tup{m-1}}{2} }.
\]

\subsection{Solution}

...

%----------------------------------------------------------------------------------------
%	EXERCISE 6
%----------------------------------------------------------------------------------------
\horrule{0.3pt} \\[0.4cm]

\section{Exercise 6}

\subsection{Problem}

Let $\tup{f_0, f_1, f_2, \ldots}$ be the Fibonacci sequence.
Prove that each nonnegative integer $n$ satisfies
\[
f_n \equiv f_{n \% 5} \cdot 3^{n//5} \mod 5 .
\]
(Here, $n//5$ and $n \% 5$ denote
the quotient and the remainder obtained when dividing
$n$ by $5$.)

\subsection{Solution}

...

%----------------------------------------------------------------------------------------
%	EXERCISE 7
%----------------------------------------------------------------------------------------
\horrule{0.3pt} \\[0.4cm]

\section{Exercise 7}

\subsection{Problem}

Let $a$ and $b$ be two \textbf{positive} integers.
Prove that there exist \textbf{positive} integers $x$ and
$y$ such that
\[
\gcd\tup{a, b} = xa - yb.
\]

\subsection{Solution}

...

%----------------------------------------------------------------------------------------
%	EXERCISE 8
%----------------------------------------------------------------------------------------
\horrule{0.3pt} \\[0.4cm]

\section{Exercise 8}

\subsection{Problem}

Prove that any positive integer $a$ can be
uniquely expressed in the form
\[
a = 3^m + b_{m-1} 3^{m-1} + b_{m-2} 3^{m-2} + \cdots + b_0 3^0
\]
where $m$ is a nonnegative integer, and where
$b_0, b_1, \ldots, b_{m-1} \in \set{0, 1, -1}$.
(This is called the \textit{balanced ternary representation}.)

\subsection{Solution}

...

%----------------------------------------------------------------------------------------
%	EXERCISE 9
%----------------------------------------------------------------------------------------
\horrule{0.3pt} \\[0.4cm]

\section{Exercise 9}

\subsection{Problem}

Let $p, q, m, n \in \NN$ with $p\leq m$ and $q\leq n$.
Consider an $m\times n$-table $T$ of integers, with all entries distinct.
In each column of $T$, we mark the $p$ largest entries with a \textit{cyan}
marker.
In each row of $T$, we mark the $q$ largest entries with a \textit{red}
marker.
Prove that at least $pq$ entries of $T$ are marked twice
(i.e., with both colors).

[\textbf{Example:} Let $p=2$ and $q=2$ and $m=3$ and $n=3$ and
\[
T = \begin{pmatrix}
1 & 2 & 9\\
4 & 3 & 8\\
5 & 6 & 7
\end{pmatrix} .
\]
Then,
\begin{align*}
&  \text{the cyan entries are } 4,5,3,6,8,9, \text{ while}\\
&  \text{the red entries are } 2,9,4,8,6,7.
\end{align*}
Thus, the entries $4,6,8,9$ are marked twice.
This is exactly the $pq$ entries claimed in the exercise.
You can easily find situations in which there are more than
$pq$ doubly-marked entries.]

\subsection{Solution}

...

%----------------------------------------------------------------------------------------
%	EXERCISE 10
%----------------------------------------------------------------------------------------
\horrule{0.3pt} \\[0.4cm]

\section{Exercise 10}

\subsection{Problem}

A \textit{bitstring} shall mean a finite sequence consisting of $0$'s and
$1$'s. (This is what we called an ``$n$-bitstring'' in the Gray code
example in the notes, except that the length is no longer fixed.)
We shall write our bitstrings without
commas and parentheses -- i.e., we shall simply write $a_1 a_2 \cdots a_n$
for the bitstring $\tup{a_1, a_2, \ldots, a_n}$.

Bitstrings can be transformed by \textit{moves}. In each \textit{move}, you
pick two consecutive entries $01$ in the bitstring (appearing in this order),
and replace them by three consecutive entries $100$ (in this order). For
example, here is a sequence of moves:
\[
01\underline{01}
\to
\underline{01}100
\to
10\underline{01}00
\to
1\underline{01}0000
\to
11000000
\]
(where we use underscores to mark the places where the moves are happening).
Note that the last bitstring in this sequence has no two consecutive entries
$01$ any more, and thus no more moves can be applied to it.

\begin{itemize}

\item[\textbf{(a)}]
Prove that there are no infinite sequences of moves. That is, if
you start with a bitstring $a$, then any sequence of moves that can be applied
successively must have an end.

[\textbf{Hint:} Given a bitstring $a$, let $n_a$ denote the number of $0$s
in $a$, and let $k_a$ be the number of $1$s in $a$. Induct on $k_a$. Within
the induction step, induct on $n_a$.]

\item[\textbf{(b)}]
\textbf{(optional; to be discussed later)} A bitstring shall be
called \textit{immovable} if no move can be applied to it. Part \textbf{(a)}
shows that, starting with any bitstring $a$, we can always reach an immovable
bitstring by performing moves until no more moves are possible. Prove that
this immovable bitstring is uniquely determined by $a$ -- that is, no matter
how you perform the moves, the immovable bitstring that results at the end
will be the same. Moreover, the number of moves needed to reach the immovable
bitstring will be the same.

\end{itemize}

\subsection{Solution}

...


\horrule{0.3pt} \\[0.4cm]

\begin{thebibliography}{99999999}                                                                                         %

\end{thebibliography}

\end{document}

