\documentclass[psamsfonts]{amsart}
\usepackage{amssymb,amsfonts}
\usepackage[all,arc]{xy}
\usepackage{enumerate}
\usepackage{mathrsfs}

%theoremstyle{plain} --- default
\newtheorem{thm}{Theorem}[section]
\newtheorem{cor}[thm]{Corollary}
\newtheorem{prop}[thm]{Proposition}
\newtheorem{lem}[thm]{Lemma}
\newtheorem{conj}[thm]{Conjecture}
\newtheorem{quest}[thm]{Question}

\theoremstyle{definition}
\newtheorem{defn}[thm]{Definition}
\newtheorem{defns}[thm]{Definitions}
\newtheorem{con}[thm]{Construction}
\newtheorem{exmp}[thm]{Example}
\newtheorem{exmps}[thm]{Examples}
\newtheorem{notn}[thm]{Notation}
\newtheorem{notns}[thm]{Notations}
\newtheorem{addm}[thm]{Addendum}
\newtheorem{exer}[thm]{Exercise}

\theoremstyle{remark}
\newtheorem{rem}[thm]{Remark}
\newtheorem{rems}[thm]{Remarks}
\newtheorem{warn}[thm]{Warning}
\newtheorem{sch}[thm]{Scholium}

\makeatletter
\let\c@equation\c@thm
\makeatother
\numberwithin{equation}{section}

\title{Not Quite Number Theory}

\author{emily bargar}

\date{August 17, 2007}

\begin{document}

\begin{abstract}

Explorations in a system given to me by L\'aszl\'o Babai, and conclusions about the importance of base and divisibility in that system.

\end{abstract}

\maketitle

\tableofcontents

\pagebreak

\section{Getting started}
In this paper, we will work within the following system (and, eventually, generalizations of it), conceived by P\'eter Frankl:

\halign{# & $#$ \cr
Starting with & 1 \cr
we double to & 2 \cr
then & 4 \cr
 & 8 \cr
 & 16 \cr}
So far this seems rather dull - we all understand and are quite familiar with the doubling function; but now that we've hit two digits, we add a second action: digital permutation.
\halign{# \hfil & $#$ & \hfil # & $#$ & \hfil # & $#$ & \hfil # & $#$ \cr
So from & 16 & & & & & & \cr
doubling gives & 32 & & & while permuting gives & 61 & & \cr
then $32$ becomes & 64 & or permutes to & 23 & and $61$ doubles to & 122 & & \cr
$64$ doubles to & 128 & or permutes to & 46 & while $122$ permutes to & 212 & or & 221. \cr}
\noindent Note that the double of $23$ and the permutation of $64$ are both $46$.

In the full statement of the system, restricting permutations such that they cannot change string length - not allowing the movement of a $0$ to the front of the number, adds further interest: we can then ask questions about possible travel time within a given string length.  However, while also interesting, this restriction is not necessary for the main results of this paper and will not be greatly examined here.

\section{Getting your feet wet}

\subsection{Drops}
Routes to a few numbers

When first introduced to this system, I was asked the following to inspire exploration: can you reach $2007$? and can you reach $2008$?  The following answers the later (former to follow later in the paper), so if you'd like to think about it yourself first, please do so now.

Easiest, of course, is to reach a specific power of two - simply doubling $n$ times leads to $2^n$.  $2008$, being a multiple of the relatively large prime $251$, is clearly not a power of $2$... however, it is exactly this factor which makes $2008$ so lucky - $251$ permutes to $512=2^9$, and with one permutation we have found exactly our route:
\halign{# \hfil & $#$ \cr
 & 1 \cr
doubles to & 2 \cr
then & 4 \cr
 & 8 \cr
 & 16 \cr
 & 32 \cr
 & 64 \cr
 & 128 \cr
 & 256 \cr
 & 512 \cr
permutes to & 251 \cr
doubling again & 502 \cr
 & 1004 \cr
and finally, & 2008 \cr}

This time, we were lucky - some numbers require many odd combinations of permuting and doubling, while this one was relatively easy to reverse-engineer.  Note, however, that involving many permutations is not the same as requiring them; for example, we could instead reach $2008$ in the following, far more convoluted but essentially similar manner:
\halign{# \hfil & $#$ \cr
 & 1 \cr
doubles to & 2 \cr
 & 4 \cr
 & 8 \cr
 & 16 \cr
 & 32 \cr
permutes to & 23 \cr
doubles to & 46 \cr
permutes to & 64 \cr
doubles to & 128 \cr
permutes to & 281 \cr
doubles to & 562 \cr
permutes to & 256 \cr
doubles to & 512 \cr
permutes to & 251 \cr
doubles to & 502 \cr
permutes to & 520 \cr
doubles to & 1040 \cr
permutes to & 4100 \cr
doubles to & 8200 \cr
permutes to & 2008 \cr}
\noindent What a surprise!
Actually, this is not particularly surprising - the key thing to notice here is that odd digits are achieved when a digit $\geq 5$ is doubled, producing a `digit' $\geq 10$ and so overflowing into the digit immediately to the left.  Careful permutation can leave all `influencing digits' in their same orientation; before a doubling, any overflowing digit will be placed to the right of the digit it would overflow into in the original string, and the rest of the permutation has no further restriction.  Slightly more surprising is the following path:
\halign{# \hfil & $#$ \cr
 & 1 \cr
doubles to & 2 \cr
 & 4 \cr
 & 8 \cr
 & 16 \cr
 & 32 \cr
 & 64 \cr
 & 128 \cr
 & 256 \cr
permutes to & 265 \cr
doubles to & 530 \cr
permutes to & 350 \cr
doubles to & 700 \cr
then & 1400 \cr
 & 2800 \cr
permutes to & 2008 \cr}
\noindent so not only paths that differ from the original by overflow-restricted permutation are capable of reaching the desired goal!

At this point, you may be wondering why this section is subtitled `Routes to a few numbers,' when so far all the routes have led to the same number.  Well, I lied - this section does not include routes to a few numbers, but neither does it include routes to just one; carefully described in the first sentence of the second paragraph are routes to infinitely many.  Having more than fulfilled the stated goal of this section, we will move on.

\subsection{Splashes}
A quick list (with proof) of small achievable numbers

$1$, clearly as the starting number, can be reached.

$2$, $4$, and $8$, simple doubles in the system before any permutation is allowed and therefore while it is completely determined and very well-understood, are also clearly achievable.

\begin{lem}
Any route can only increase its string length - this system does not allow for decrease in the number of digits.
\end{lem}
\begin{proof}
Two functions are available to us: doubling and permutation.

\noindent Doubling, by definition, is an increase by the number again - never will a doubled natural number grow smaller.

\noindent Permutation can lead to smaller numbers, true, but the statement of the system specifically disallows movement of a $0$-digit to the front.

\noindent Permutation is restricted from changing string length, and doubling can only increase it; therefore, decrease is impossible.
\end{proof}

$8$ doubles to $16$ and here, finally, with two digits and the capability to permute we gain some freedom in our system, but by Lemma 2.1, as we've already passed the one-digit numbers, $3$, $5$, $6$, $7$, and $9$ are unachievable.

$10$, although technically 2 digits, also falls into this trap - permutation would bring its $0$ to the front and is not allowed, while to double to it you'd have to first reach $5$, already shown to be impossible, and so it is unachievable.

\begin{lem}
Odds are achievable only through permutation, not doubling.
\end{lem}

$11$, then, can only be reached by permutation; but $11$ only permutes to $11$, unachievable save possibly by permutation and therefore not at all.

With $12$ it seems we have slightly more luck - although $6$ is unachievable and so we must permute to reverse-engineer a path, at least we have that option.  However, $12$ permutes to $21$, odd and so only achievable by permutation - $21$ is achievable if and only if $12$ can be reached by doubling, which it cannot.

\begin{cor}
Two-digited numbers with odd first digits are achievable if and only if they are achievable by doubling.
\end{cor}
\begin{proof}
A two-digited number has but one alternative permutation: the switching of its two digits.  The movement of an odd first digit to the last digit, then, will leave this number odd, only achievable by permutation by Lemma 2.2 and so leading us back to the original number.  Permutation leads us around in circles, and so is not a useful tactic - only doubling is available.
\end{proof}

$10$ through $19$ all fall victim to this issue - by Corollary 2.3 they are only achievable through doubling, but by Lemma 2.2 the odds in the bunch already aren't achievable in this manner either, and those that are even are then left to deal with the issue of being twice a one-digit number, many of which are unachievable.  Only $16$, the double of $8$ and already well-established as so, is an achievable teen.

$20$, like $10$ and in fact any two-digit multiple thereof, is restricted from permutation, but being the double of $10$ which is unachievable, it also is.

$21$ is odd - by Lemma 2.1 we must permute to it, but $12$ is unachievable so $21$ is, too.

$22$, like $11$ and two-digit multiples of it, permutes only to itself, and so must be reached by doubling - but $11$, half of $22$, is unachievable.

$23$ is a permutation of $32$, achievable as it is a power of $2$ - this gives us a taste of how the rest of this examination under $100$ should go: $1$, $2$, $4$, $8$, $16$, $23$ are our list of achievable numbers so far, with nothing between these achievable as proved above using these principles of how permutations, doubling, odds, and previously found achievable/unachievable numbers interact.  We find that $24$, in one direction the double of $12$ and in the other the permutation of $42$ which is double $21$, is unachievable.  $25$, odd, must be permuted to $52$ which can halve to $26$ and again to $13$ - unachievable, or instead permute to $62$ and halve to $31$, also all odd-digited and also unachievable.  We can continue examination through to $99$ in this manner.

These principles can be used to examine higher-length strings of digits as well, but become less useful the more digits are in play: Corollary 2.3 is generalizable to $n$-digit numbers where the first $n-1$ digits are odd, at which point we can mix it with Lemma 3.2 to find that all numbers with all odd digits are unachievable - however, while in two digits this takes out $\frac{1}{4}$ of the possibilities, at three digits we're down to $\frac{1}{8}$, while in the thousands it only handles $\frac{1}{16}$ of the numbers out there.  Luckily, Lemma 2.1 implies for any digit-length range that we only have to worry about a finite list of possible influences: none of the countably many natural numbers greater than the next power of $10$ can come back around in some route to reach one of the numbers in that particular stretch.

\subsection{Puddles}
Bases $2$, $4$, $8$, ..., $2^n$

So far we've been working solely in base $10$, but why limit ourselves to this?  Perhaps expanding our view can add further insight into both the generalized and the original systems.

Unfortunately, will all other original rules in place, the first place you'd think to look - base $2$, being the smallest nontrivial base and so perhaps easiest to handle, by nature of the system's built-in reliance on $2$ is completely determined!  For example:

\noindent $1$

\noindent $10$

\noindent $100$

\noindent $1000$

\noindent $10000$

\noindent ... and so on.  Of course, doubling in base $2$ is just like multiplying by $10$ in our more familiar base $10$ - it just adds a $0$ to the end of the string.  With only one nonzero digit to work with, we cannot permute and so have no choice but to double again, the whole way through.

\pagebreak
Base $4$, while slightly more promising, is ultimately not at all better.

\noindent $1$

\noindent $2$

\noindent $10$

\noindent $20$

\noindent $100$

\noindent $200$

\noindent $1000$

\noindent ... et c.  Similarly base $8$ brings us through $1$, $2$, then $4$ before wrapping back around with $0$ at the end - base $2^n$ is problematic, in that it is always under these rules entirely determined: moving through powers of $2$ in a base which is a power of $2$ means only ever one digit is nonzero - there's too much divisibility in play for permutations to ever get a chance.

\section{Getting somewhere}

\subsection{Base $3$}
Why $10$ isn't special

Having now explored infinitely many nonintersecting bases, we start to feel rather awesome for happening to have $10$ fingers instead of perhaps $8$ or $16$... but we must not let this feeling get the best of us, for base $10$, although it may be seeming it right now, is not at all the only interesting case.  Already in base $3$, the next one up, we encounter a diverse universe not determined solely by doubles and at a glance very different from the base we know and love.

Oh, and - for interest's sake, let's generalize even further, looking not just at $1$ as our start but any natural number.  It doesn't really help us - this is not a trick to make base $3$ seem more interesting than $2$; rather, it allows us to show just how powerful the following finding is.

\begin{thm}
Save the starting number or permutations thereof, odd numbers are unachievable in base $3$.
\end{thm}

\begin{rem}
To start, of course, this means we have to know what it means to \textit{be} odd in base $3$.  In base $10$, odd numbers are quickly identified by a glance at their last digit - $1$, $3$, $5$, $7$, or $9$ means odd, while the evens imply even.  We could easily assume this to be a definition of odd, the two facts are used so interchangeably in base $10$, but what's really going on here has far less to do with the last digit in a given base and far more to do with the implications of digital placement.

In any base, the $1$s place will, of course, affect parity.  What leaves base $3$ seeming so odd to us is that, while in base $10$ we then have the $10$s place, the $100$s place, the $1000$s place and so on - all powers of $10$ and therefore even numbers, in base $3$ instead we go on to the $3$s place, the $9$s place and the $27$s place - all powers of $3$, and so all odd.  In base $10$ we need only worry about the $1$s place because every other digit gets multiplied by $2$ (and $5$, at least), rendering it even.  In base $3$, each multiplier is odd, and so oddness is determined by the number of places at which odd numbers are contributed - the number of odd digits.
\end{rem}

\begin{proof}
In any base, doubling leads to evens - by Lemma 2.2, in seeking achievable odds we need only concern ourselves with permutation.

In base $10$, random permutation moving the parity-inducing digit to a different place replaces it with an unrelated digit, switching parity unpredictably.  In base $3$, however, each digit is already contributing to parity: an odd digit, switched to a different place, is now associated with an odd multiplier, while before it was... also associated with an odd multiplier - there is no change to parity from this move.  Similarly, an even digit switches from an odd multiplier to an odd multiplier, which doesn't matter anyhow as it's even and so will contribute similarly to the parity no matter what multiplier it is paired with.  In base $3$, permutation preserves parity.

After at least one doubling, then, any number in this system in base $3$ is guaranteed to be even - doubling makes it even by definition, and by the above argument permutation will leave it there; our only resort would be to attempt another doubling, which if anything makes it `more' even!  The only achievable odds are those possibly reachable before any doubling - the starting number, which if already even leave us with none, and if odd its permutations.
\end{proof}

\subsection{Odd Base}
Why $3$ isn't special

At this point, a rare few are probably now upset at having $10$ fingers instead of the obviously mathematically deeper and far more wonderful $3$ - for them we have both good and bad news.  The good: we're not actually using the `$3$'ness of $3$ anywhere in this proof; this theorem holds for infinitely many bases!  The bad: $10$, being even, is not one of them.

\begin{thm}
Save the starting number or permutations thereof, odd numbers are unachievable in odd base.
\end{thm}
\begin{proof}
The key step in Theorem 3.1 - that every multiplier contributes equally to a number's parity, relies not on some property specific to $3$, but rather only that $3$ is odd!  For all odd $n$, $n^2$, $n^3$, ..., $n^k$ ($k \in \mathbb{N}$) are also odd (this can be quickly proved using induction and the fact that the product of two odds is also odd); for example $1$, $3$, $9$, $27$, ....  These multipliers, then, all interact equally with the digital coefficients; it does not matter, when examining only parity, with which power of $n$ each digit is associated.  

As the number itself is the sum of the multiplied digits and multipliers, the number of odd digits entirely determines the number's parity: conveniently, odd implies odd and even even.  Permutation, simply moving the digits around without further alteration, does not change this!  So in \textit{any} odd base, parity is preserved by permutation; after at least one doubling, odds are unachievable.
\end{proof}
\begin{rem}
In any base, similar principles can be applied - separate permutations on the sets of digits associated with odd and even multipliers respectively will preserve parity; we've already explored the consequences of this in odd base.  Evens, such as base $10$, have but one odd multiplier - the $1$s place, while all else is even; permutation restricted to the non-$1$ places, then, will preserve parity in even base.
\end{rem}

\subsection{Base $10$}
Exploration/explanation of $3$s and $9$s

Sadly, $10$ is not odd, and so while Theorem 3.3 seems very powerful, it is completely useless to the original problem.  What's not useless, however, is again the principle behind the proof.  In odd base, divisibility by two has the special property that it is preserved by digital permutation - base $10$ has numbers that do this, too!

\pagebreak
The well-known divisibility rules of $3$ and $9$ - that a number is divisible by each of these respectively if and only if the sum of its digits is, too, play on this trick:

\begin{thm}
Divisibility by $3$ or $9$ is preserved by permutation in base $10$.
\end{thm}
\begin{rem}
Similar to examining what it meant to be odd in an odd base, we now look at what it means to be divisible by $3$ or $9$ in base $10$ - how is each multiplier contributing?  For these purposes, we want to `deconstruct' our place multipliers in a clever manner, examining their relative `$3$-ness' and `$9$-ness'.

For example, when multiplying by $10$, we can consider ourselves to be multiplying instead by $9+1$.  The resulting number, then, is divisible by $9$ if and only if the original was - we have the multiplier contributing a neutral $9$ piece and the original number back.  If instead we were multiplying by $11=9+2$, the resulting number would be divisible by $9$ if twice the original was.  Of course, as $9$ is odd, $9|2x$ if and only if $9|x$, but this turns out not to even be necessary - we need only distinguish between different remainders of placeholders when divided by $3$ or $9$.


\end{rem}
\begin{proof}
Case for $3$, by induction.

Hypothesis:  If $3|(10^k-1)$, then $3|(10^{k+1}-1)$.

Base case(s):

$3|(1-1)=0$ 

$3|(10-1)=3*3$

Inductive step:  Assume $3|(10^k-1)$.

\halign{\qquad \hfil $#$ & $=#$ \hfil \cr
10^{k+1}-1 & 10(10^k)-1 \cr
 & (3*3+1)10^k-1 \cr
 & (3*3)10^k+10^k-1 \cr
 & 3(3*10^k)+(10^k-1) \cr}

\noindent $3|3(\hbox{anything})$ and $3|10^k-1$ by the inductive hypothesis, so $3$ divides this sum; $3|(10^{k+1}-1)$.  By the above remark, every place multiplier contributes equally to the divisibility by $3$ of a number, and so permutation preserves this property.
\end{proof}

\begin{proof}
Case for $9$, by nearly the same argument.

Hypothesis:  If $9|(10^k-1)$, then $9|(10^{k+1}-1)$.

Base case(s):

$9|(1-1)=0$ 

$9|(10-1)=9$

Inductive step:  Assume $9|(10^k-1)$.

\halign{\qquad \hfil $#$ & $=#$ \hfil \cr
10^{k+1}-1 & 10(10^k)-1 \cr
 & (9+1)10^k-1 \cr
 & 9*10^k+10^k-1 \cr
 & 9(10^k)+(10^k-1) \cr}

\noindent $9|9(\hbox{anything})$ and $9|10^k-1$ by the inductive hypothesis, so $9$ divides this sum; $9|(10^{k+1}-1)$.  Again, each place multiplier contributes equally to the divisibility by $9$ of a number - permutation does not affect the outcome.
\end{proof}

\begin{rem}
$9|2007$, and so $2007$ cannot be reached from starting number $1$.
\end{rem}

\subsection{Base $n$}
Complete generalization

We started this paper in a highly restricted system - one specific base, one specific starting number, and two generally well-understood actions that just have not been very well-observed interacting.  We generalized to any base.  We generalized to any starting number.  Why are we restricting ourselves to simply doubling, when we could triple, quadruple, or multiply by any integral constant?

Nowhere in our proofs of $3$ and $9$'s specialness in base $10$ do we use the fact that we double - the only thing counted upon is that nondivisibility will be preserved under the actions of this system.  So long, then, as our constant is relatively prime to the divisor in question, it will also not interfere with the divisibility, leaving a route's divisibility determined entirely by the starting number.

Also not widely used in the above proofs are anything special to $3$ or $9$ - just that they have this nifty factoring trick in base $10$.  This is highly modifiable.

\begin{lem}
In base $n$, factors of $n-1$ are preserved under permutation.
\end{lem}
\begin{proof}
By induction.

Hypothesis:  If $m$ is a factor of $n-1$ such that $m|(n^k-1)$, then $m|(n^{k+1}-1)$.

Base case(s):

$m|(1-1)=0$ 

$m|(n-1)$ by definition.

Inductive step:  Assume $m|(n^k-1)$.

\halign{\qquad \hfil $#$ & $=#$ \hfil \cr
n^{k+1}-1 & n(n^k)-1 \cr
 & ((n-1)+1)n^k-1 \cr
 & (n-1)*n^k+n^k-1 \cr
 & (n-1)(n^k)+(n^k-1) \cr}

\noindent $m|(n-1)(\hbox{anything})$ by definition and $m|n^k-1$ by the inductive hypothesis, so $m$ divides this sum; $m|(n^{k+1}-1)$.  Then each place multiplier contributes equally to the number's divisibility by $m$, and so permutation preserves divisibility by $m$.
\end{proof}

This means that, with odd multiplier in an odd base, we are no longer restricted to evens or even just to odds, but rather that the parity of the starting number determines parity of the entire route.  In base $10$, for any multiplying constant not divisible by $3$, again divisibility of the starting number determines divisibility of the route, this time dividing into three possible categories: not divisible by $3$, divisible by $9$, and divisible by $3$ but not $9$.  In base $16$, where $15$ is divisible by $3$ and $5$, we now get four: neither divisible by $3$ nor $5$, divisible by $3$ and not $5$, divisible by $5$ and not $3$, and divisible by both (by $15$).  Other bases ($n$) are similarly divided by factors of $n-1$.

\begin{thm}
In base $n$, given a multiplying constant relatively prime to divisors of $n-1$, the `divisibility class' of any number along a route is entirely determined by the starting number.
\end{thm}
\begin{proof}
All the necessary steps for this have already been outlined in this section.

By Lemma 3.8, permutation will preserve divisibility.

The multiplying constant can only add divisibility by its own factors - one relatively prime to the divisors in question, then, will not alter the relative divisibility or nondivisibility of numbers farther along the route.

Starting numbers and the ensuing routes, then, are partitioned into divisibility classes by these factors of $n-1$ - one for each different combination of prime factors, as each new addition separates those routes from the previously conceived ones.
\end{proof}

I can't help you if you're still upset about how many fingers you have - I think $16$ is much cooler, too, and I'm sure many computer scientists would agree for entirely unrelated reasons.
\end{document}

