\documentclass[12pt,reqno]{article}
\usepackage[usenames]{color}
\usepackage{amssymb}
\usepackage{graphicx}
\usepackage{amscd}
\usepackage[colorlinks=true,
linkcolor=webgreen,
filecolor=webbrown,
citecolor=webgreen]{hyperref}
\definecolor{webgreen}{rgb}{0,.5,0}
\definecolor{webbrown}{rgb}{.6,0,0}
\usepackage{color}
\usepackage{fullpage}
\usepackage{float}
\usepackage{psfig}
\usepackage{graphics,amsmath,amssymb}
\usepackage{amsthm}
\usepackage{amsfonts}
\usepackage{latexsym}
\usepackage{epsf}
\setlength{\textwidth}{6.5in}
\setlength{\oddsidemargin}{.1in}
\setlength{\evensidemargin}{.1in}
\setlength{\topmargin}{-.5in}
\setlength{\textheight}{8.9in}
\newcommand{\seqnum}[1]{\href{http://oeis.org/#1}{\underline{#1}}}
\begin{document}
\begin{center}
\epsfxsize=4in
\leavevmode\epsffile{logo129.eps}
\end{center}
\begin{center}
\vskip 1cm{\LARGE\bf
Circular Permutations Avoiding Runs of $i,i+1,i+2$ or $i,i-1,i-2$\\
}
\vskip 1cm
\large
Wayne M. Dym\'a\v cek and Isaac Lambert\\
Department of Mathematics\\
Washington and Lee University\\
Lexington, Virginia 24450 \\
USA\\
\href{mailto:dymacekw@wlu.edu}{\tt dymacekw@wlu.edu}\\
\end{center}
\vskip .2 in
\theoremstyle{plain}
\newtheorem{theorem}{Theorem}
\newtheorem{corollary}[theorem]{Corollary}
\newtheorem{lemma}[theorem]{Lemma}
\newtheorem{proposition}[theorem]{Proposition}
\theoremstyle{definition}
\newtheorem{definition}[theorem]{Definition}
\newtheorem{example}[theorem]{Example}
\newtheorem{conjecture}[theorem]{Conjecture}
\theoremstyle{remark}
\newtheorem{remark}[theorem]{Remark}
%%%%%%%%%%%%%%%%%%%%%% Macros %%%%%%%%%%%%%%%%%%
\newcommand{\Cp}[1]{\ensuremath{\mathcal{C}^*(#1)}}
\newcommand{\SP}[1]{\ensuremath{\mathcal{S}^*(#1)}}
\newcommand{\Cpm}[1]{\ensuremath{\overline{\mathcal{C}^*}(#1)}}
\newcommand{\Spm}[1]{\ensuremath{\overline{\mathcal{S}^*}(#1)}}
\newcommand{\B}[3]{\ensuremath{\mathcal{B}_{{#1}\dots{#2}}^{#3}}}
\newcommand{\Bp}[3]{\ensuremath{\mathcal{B}_{{#1}\dots{#2}}^{*{#3}}}}
\newcommand{\Cpx}[2]{\ensuremath{\mathcal{C}^*(#1,#2)}}
\newcommand{\Spmx}[2]{\ensuremath{\overline{\mathcal{S}^*}(#1,#2)}}
\newcommand{\cp}[1]{\ensuremath{{c}^*(#1)}}
\newcommand{\sP}[1]{\ensuremath{{s}^*(#1)}}
\newcommand{\cpm}[1]{\ensuremath{\overline{{c}^*}(#1)}}
\newcommand{\spm}[1]{\ensuremath{\overline{{s}^*}(#1)}}
\newcommand{\bp}[3]{\ensuremath{{b}_{{#1}\dots{#2}}^{*{#3}}}}
\newcommand{\cpx}[2]{\ensuremath{{c}^*(#1,#2)}}
\newcommand{\spmx}[2]{\ensuremath{\overline{{s}^*}(#1,#2)}}
\begin{abstract}
In this paper we examine permutations that avoid
increasing or decreasing runs and extend known results to the circular
and modular cases,
allowing us to calculate sequence \seqnum{A078628} in Sloane's
{\it On-Line Encyclopedia of Integer Sequences}.
\end{abstract}
\section{Introduction}
The main purpose of this paper is to answer the following question: In how many ways can $n$ cards, numbered 0
to $n-1$, be placed in a circle so that no three consecutive cards are labeled consecutively? For example, if
$n=8$, then both of the following permutations have consecutively labeled cards in positions 3, 4, and 5 (we
use 0-origin): $(5,1,0,2,3,4,6,7)$ and $(5,1,0,4,3,2,6,7)$. If we consider $(n-1,0,1)$ and $(n-2,n-1,0)$ as
consecutively labeled cards, then this sequence of numbers is sequence A078628 in Sloane's Encyclopedia
\cite{Sloane} which previously had only thirteen terms calculated. We actually consider four sequences and we
begin with the following definition.
\begin{definition}A permutation $\pi=(a_0,a_1,\dots,a_{n-1})$ has a run if there is an $i$ such that either
$a_{i+1}= a_i + 1$ and $a_{i+2}= a_i + 2$ or $a_{i+1}= a_i - 1$ and $a_{i+2}= a_i - 2$. If the equalities are
replaced by congruences modulo $n$, then the runs are modular runs. The set of $n$-long permutations
without runs is denoted by $\SP{n}$ and the set without modular runs is denoted by $\Spm{n}$.
\end{definition}
As is customary, we denote the size of $\SP{n}$ by $\sP{n}$ and likewise for the other sets in this paper. A
{\it circular permutation\/} $\pi=(a_0,\dots,a_{n-1})$ is a permutation in which the indices are from the ring
of integers modulo $n$ and so there are $(n-1)!$ circular permutations on $n$ objects. We let $\Cp{n}$ be the
set of $n$-long circular permutations that have no runs and $\Cpm{n}$ be the set of circular permutations
without a modular run. Note that $\cpm{n}$ is the sequence A078628 mentioned above and that for $n=8$, neither
$(0,1,5,4,6,2,3,7) = (7,0,1,5,4,6,2,3)$ nor $(0,7,5,4,6,2,3,1) = (1,0,7,5,4,6,2,3)$ are in $\Cpm{n}$
since both have modular runs $(7,0,1)$ and $(1,0,7)$ respectively, but $(1,0,6,4,5,7,2,3)$ is in $\Cpm{n}$.
In the following, we often need to create a regular permutation from a circular one. This process we call {\it
flattening.\/} If $\pi= (a_0,\dots,a_{n-1})$ is a circular permutation, then $\pi^{f_a}$ is $\pi$ flattened at
$a$ if $i$ is the index for which $a_i= a$ and $\pi^{f_a} = (a_i, a_{i+1},\dots,a_{n-1},a_0, \dots, a_{i-1})$.
If we flatten at 0, then we denote this by $\pi^f$. Changing a regular permutation into a circular one is
straightforward. If $\pi=(a_0,\dots,a_{n-1})$ is a regular permutation, then $\pi$ {\it circularized\/} is the
circular permutation $\pi^c=(a_0,\dots,a_{n-1})$.
Note that if $\pi$ has no runs, then $\pi^{f_a}$ has no runs but it is possible to flatten a circular
permutation in the middle of a run so that the run is not preserved in the flattened permutation. Also, a
regular permutation $\pi$ may not have a run but $\pi^c$ might. For example,
$\pi=(3,5,0,6,4,1,2)$ does not have a run but $\pi^c = (3,5,0,6,4,1,2) = (1,2,3,5,0,6,4) $ has the run
$(1,2,3)$.
One other useful operation we call {\it prepending}. Given a straight permutation $\pi=(a_1,\dots,a_n)$ of
length $n$, prepending $a_0$ gives us a straight permutation $(a_0,a_1,\dots,a_n)$ of length $n+1$. We must
take care when prepending $a_0$ to $\pi$ that we actually get a permutation. Likewise {\it appending} adds a
digit to the end of a straight permutation.
If $\pi=(a_0,\dots,a_{n-1})$ is a permutation (straight or circular), then $-\pi=(n-1-a_0,\dots,n-1-a_{n-1})$
is also a permutation. Again, $\pi$ has no runs if and only if $-\pi$ has no runs.
The context for this paper is the study of arithmetic progressions in permutations. There are at least two ways
of defining an arithmetic progression in a permutation $\pi= (a_0,a_1,\dots,a_{n-1})$. We follow Hegarty
\cite{Hegarty} in defining a progression of rise $r$ and distance $d$ in $\pi$ as a sequence $(a_i,
a_{i+d},a_{i+2 d})$ where $r= a_{i+d}- a_i = a_{i+2 d}-a_{i+d}$. Note that a run is a progression with
distance $d=1$ and rise $r=\pm 1$.
Riordan \cite{Riordan} computed the number of permutations with $x$ progressions of rise $r=1$ and $d=1$ and
called them 3-sequences. He noted that these were generalizations of a topic Whitworth considered, see
\cite[pp.~103--107]{Whitworth}. Charalambides \cite[pp.~176--184]{Charalambides} further generalized
Whitworth's sequences. Jackson and Read \cite{JackRead} called progressions of distance 1
and rise $\pm 1$ increasing runs if $r=1$ and decreasing runs if $r=-1$ and they gave generating
functions for the number of permutations without progressions with $d=1$ and $r=\pm 1$ of length
$\ell$. Jackson and Reilly \cite{JackRei} derived a generating function for the number of permutations with
exactly $x$ increasing runs of length $\ell$ and showed that the computation of the number of such
permutations is $O(n^3)$. Myers \cite{Myers} called a progression of rise 1 and distance 1 a block and counted
the number of permutations that contains $m$ blocks. He also considered rigid patterns and noticed that
difficulties occur if patterns can be interweaved.
The definition of an arithmetic progression in the permutation $\pi$ that we are {\em not} using is a sequence
$(a_i, a_{j},a_{k})$ with $0\le i < j < k6$.
Using Theorem~\ref{barCp=Cp-stuff} and Lemma~\ref{Bp01n-1n2} and then Lemma~\ref{Bp01n-1n}, we can rewrite
$\cpm{n}$ in terms of just $\cp{n}$ and $\bp{0,1}{n-2,n-1}{n}$.
\begin{corollary} For $n \ge 3$, $\cpm{n} = \cp{n} -2\bp{0,1}{n-2,n-1}{n} - 4 \bp{0,1}{n-1,n}{n+1}$.
\label{barCp=Cp-same}
\end{corollary}
For completeness, we now sketch the proof of the connection between the second and third columns of
Table~\ref{r=+-1}. If $\pi = (a_0,\dots,a_{n-1})$, then for $j$ an integer we define $\pi + j$ to be the
permutation $(a_0+j,\dots,a_{n-1}+j)$ where all additions are modulo $n$. Note that $\pi$ and $\pi+j$ have the
same number of modular runs.
\begin{theorem} For $n\ge 3$ and for $x>0$, $n \cdot \cpx{n}{x} =\spmx{n}{x}$ where $\Spmx{n}{x}$ is the set
of permutations with exactly $x$ modular runs and $ \Cpx{n}{x}$ is the set of circular permutations with
exactly $x$ runs.
\label{nCp(n,x)=S(n,x)}
\end{theorem}
\begin{proof}First consider a permutation $\pi=(0,a_1,\dots,a_{n-1})$ in $\Cp{n,x}$. The basic goal of
this proof is to flatten $\pi$ at $0$ to get $\pi^{f}$ and create a set of $n$ straight permutations
$\Pi=\{\pi^f,\pi^f+1,\dots,\pi^f+(n-1)\}$, each of which will have the same number of modular runs as
$\pi$ has runs. But since flattening may remove a run from the original permutation, there are four cases.
{\bf Case 1: } Either $a_1\ne n-1$ or $a_2\ne n-2$ and either $a_{n-2}\ne 2$ or $a_{n-1}\ne 1$. In this case we
simply need to flatten the permutation at $0$ and create the set $\Pi$ as above.
{\bf Case 2: } $a_1 = n-1$ and $a_2 = n-2$ and $a_{n-2}= 2$ and $a_{n-1}= 1$. In this case we flatten the
permutation at $0$ and create the set $\Pi$ as above. Note that $(2,1,0)$ is a run in the
circular permutation and $(0,n-1,n-2)$ is a modular run in the straight permutation $\pi^f$. Hence
$\pi$ and $\pi^f$ have the same number of runs.
{\bf Case 3: } $a_1 = n-1$ and $a_2 = n-2$ and either $a_{n-2}\ne 2$ or $a_{n-1}\ne 1$. In this case we
consider $\gamma= \left[ -\pi' \right]^{f}$, where $-\pi'$ is $-\pi$ reversed. Hence
$\gamma=(0,-a_{n-1},\dots,-a_3,2,1)$ and has the same number of modular runs as $\pi$ has runs.
We use $\gamma$ to create the set of $n$ modular permutations that corresponds to $\pi$.
{\bf Case 4: } Either $a_1\ne n-1$ or $a_2\ne n-2$ and $a_{n-2}= 2$ and $a_{n-1}= 1$. We again
consider $\gamma= \left[ -\pi' \right]^{f}$, where again $-\pi'$ is $-\pi$ reversed. Hence
$\gamma=(0,{n-1},n-2,-a_{n-3},\dots,-a_3)$ and has the same number of modular runs as $\pi$ has runs.
It is not difficult to show that the $n$ permutations produced by each of these cases are unique. If
$\pi=(a_0,a_1,\dots,a_{n-1})$ is in $\Spm{n,x}$, then $\pi-a_0$ will fit one of the four cases above.
Circularize $\pi-a_0$ and it will be the permutation that gives rise to the set of $n$ straight permutations
$\{ \pi+j: 0\le j < n\}$.
\end{proof}
\begin{corollary} For $n \ge 3$, $n \cdot \cp{n} = \spm{n}$.
\label{nCp=S}
\end{corollary}
\begin{proof} By the above theorem, $n \cdot \cp{n} = n \cdot [(n-1)! - \sum_{x>0}\cpx{n}{x}] = n! -
\sum_{x>0}\spmx{n}{x} = \spm{n}$, as desired.
\end{proof}
\section{Probability}
It is not surprising that the probability that a permutation of length $n$ does not have runs is close to 1.
In this section we verify this by showing that the probability that our deck of cards from the introduction has
no runs is essentially~1.
Since there are two ways to choose a modular run (increasing or decreasing), $n-2$ ways to choose the starting
position of the run, $n$ ways to choose the starting value of the run, and $(n-3)!$ ways to place the remaining
$n-3$ numbers in the permutation, there are at most $2(n-2)n(n-3)!$ permutations that have a modular run. Hence
$\spm{n} \ge n!- 2(n-2)n(n-3)!$ and so
$$
\frac{\spm{n}}{n!} \ge 1 - \frac{2}{n-1}.
$$
Hence we have the following:
\begin{theorem} The probability that a permutation of length $n$ does not have a modular run approaches 1 as $n$
approaches infinity.
\label{big barS=1}
\end{theorem}
Since $\sP{n} > \spm{n}$, we also have
\begin{corollary} The probability that a permutation of length $n$ does not have a run approaches 1 as $n$
approaches infinity.
\label{big S=1}
\end{corollary}
For circular permutations, position does not matter so there are at most $2 n(n-3)!$ circular permutations that
contain a modular progression. Hence
$$
\frac{\cpm{n}}{(n-1)!} \ge 1- \frac{2 n}{(n-1)(n-2)}.
$$
Again, since $\cp{n}\ge \cpm{n}$, we have
\begin{theorem} The probability that a circular permutation of length $n$ does not have a modular run approaches
1 as $n$ approaches infinity and the probability that a circular permutation of length $n$ does not have a run
approaches 1 as $n$ approaches infinity.
\label{big barC=1}
\end{theorem}
\section{Sequences}
This paper deals with sequences \seqnum{A002629}, \seqnum{A078628}, \seqnum{A095816}, \seqnum{A165963}, and \seqnum{A165964}. The first
fifty terms of sequence \seqnum{A078628} are as follows:
\medskip
$\cpm{1} = 0$
$\cpm{2} = 0$
$\cpm{3} = 0$
$\cpm{4} = 4$
$\cpm{5} = 12$
$\cpm{6} = 76$
$\cpm{7} = 494$
$\cpm{8} = 3662$
$\cpm{9} = 30574$
$\cpm{10} = 284398$
$\cpm{11} = 2918924$
$\cpm{12} = 32791604$
$\cpm{13} = 400400062$
$\cpm{14} = 5281683678$
$\cpm{15} = 74866857910$
$\cpm{16} = 1135063409918$
$\cpm{17} = 18330526475060$
$\cpm{18} = 314169905117860$
$\cpm{19} = 5695984717957246$
$\cpm{20} = 108921059813769710$
$\cpm{21} = 2190998123920252622$
$\cpm{22} = 46250325111346491694$
$\cpm{23} = 1022301429750398188716$
$\cpm{24} = 23613740754886647958180$
$\cpm{25} = 568950024006846904093598$
$\cpm{26} = 14274866445575578119743438$
$\cpm{27} = 372374376152806360290989110$
$\cpm{28} = 10084828164172773195319256062$
$\cpm{29} = 283174462307289209810184927092$
$\cpm{30} = 8233653220849232427790328045876$
$\cpm{31} = 247614562274689810303882719509278$
$\cpm{32} = 7693604324191919134660311677872254$
$\cpm{33} = 246722167225395915065853140640911086$
$\cpm{34} = 8158170043027413464766703084133765486$
$\cpm{35} = 277900813774915739274082551738004741004$
$\cpm{36} = 9743794575197519961922090241025348596308$
$\cpm{37} = 351363839903830230918432098902818922192894$
$\cpm{38} = 13021021361761744809803587469208204799416830$
$\cpm{39} = 495539146920588230240234245219779841743108086$
$\cpm{40} = 19353425998749866625987965362312555548402003838$
$\cpm{41} = 775178453748407731849560920571080474371157593332$
$\cpm{42} = 31822940480660363909632901120497416610409109814276$
$\cpm{43} = 1338188780079916734821715054077664877231344980041022$
$\cpm{44} = 57608766415416937793463862738387567270274014040964686$
$\cpm{45} = 2537585460353397962654355343635847873682378459704820302$
$\cpm{46} = 114311753947370344920005481482946829653263862575017508398$
$\cpm{47} = 5263639446015081410706509916195602027644548310012924070828$
$\cpm{48} = 247629532177056272405843061340997818641369089724829503112772$
$\cpm{49} = 11897189001344425293916047304884946295425321612277069481144286$
$\cpm{50} = 583477983942047048226466538472338140101669906331645943031808878$
\section{Acknowledgments}
The first author was supported by one of Washington and Lee
University's Lenfest Summer Grants. Parts of this paper are from Isaac
Lambert's honors thesis. We appreciated the suggestions of a referee.
\begin{thebibliography}{99}
\bibitem{Abramson}M. Abramson and W. O. J. Moser, Permutations without rising or falling
$\omega$-sequences, \emph{Ann.~Math.~Statist.} \textbf{38} (1967), 1245--1254.
\bibitem{Charalambides}C. A. Charalambides, \emph{Enumerative Combinatorics}, CRC Press, 2002.
\bibitem{Davis}J. A. Davis, R. C. Entringer, R. L. Graham, and G. J. Simmons, On permutations containing
no long arithmetic progressions, \emph{Acta Arith.} \textbf{34} (1977/78), 81--90.
\bibitem{Entringer} R. C. Entringer and D. E. Jackson, Elementary Problem 2440, \emph{Amer.\ Math.\ Monthly}
\textbf{80} (1973), 1058.
\bibitem{Hegarty}P. Hegarty, Permutations avoiding arithmetic patterns, \emph{Electron.~J. Combin.} \textbf{11}
(2004), \#R39.
\bibitem{JackRead}D. M. Jackson and R. C. Read, A note of permutations without runs of given length,
\emph{ Aequationes Math.} \textbf{17} (1978), 336--343.
\bibitem{JackRei}D. M. Jackson and J. W. Reilly, Permutations with a prescribed number of p-runs, \emph{Ars
Combinatoria} \textbf{1} (1976), 297--305.
\bibitem{Lyndon}R. C. Lyndon, Solution to Elementary Problem 2440, \emph{Amer.\ Math.\ Monthly} \textbf{82}
(1975), 74--75.
\bibitem{Myers}A. N. Myers, Counting permutations by their rigid patterns, \emph{ J. Combin.\ Theory Ser.~A}
\textbf{99} (2002), 345--357.
\bibitem{Odda}T. Odda, Solution to Elementary Problem 2440, \emph{Amer.\ Math.\ Monthly} \textbf{82} (1975), 74.
\bibitem{Riordan}J. Riordan, Permutations without 3-sequences, \emph{ Bull.~Amer.~Math.~Soc.} \textbf{51}
(1945), 745--748.
\bibitem{Sharma}A. Sharma, Enumerating permutations that avoid three term arithmetic progressions,
\emph{Electron.~J. Combin.} \textbf{16}, (2009) \#R63.
\bibitem{Simmons}G. J. Simmons, Comment on Elementary Problem 2440, \emph{Amer.\ Math.\ Monthly} \textbf{82}
(1975), 76--77.
\bibitem{Sloane} N. J. A. Sloane,
The On-Line Encyclopedia of Integer Sequences, available electronically
at \href{http://oeis.org}{\tt http://oeis.org}.
\bibitem{Thomas}H. E. Thomas Jr., Solution to Elementary Problem 2440, \emph{Amer.\ Math.\ Monthly} \textbf{82}
(1975), 75--76.
\bibitem{Whitworth}W. A. Whitworth, \emph{Choice and Chance}, Hafner, 1965.
\end{thebibliography}
\bigskip
\hrule
\bigskip
\noindent 2010 {\it Mathematics Subject Classification}:
Primary 05A05; Secondary 05A15.
\noindent \emph{Keywords: } permutation, circular permutation, run,
arithmetic progression.
\bigskip
\hrule
\bigskip
\noindent (Concerned with sequences
\seqnum{A002629},
\seqnum{A078628},
\seqnum{A095816},
\seqnum{A165963}, and
\seqnum{A165964}.)
\bigskip
\hrule
\bigskip
\vspace*{+.1in}
\noindent
Received January 15 2010;
revised version received July 14 2010; January 19 2011.
Published in {\it Journal of Integer Sequences},
February 8 2011.
\bigskip
\hrule
\bigskip
\noindent
Return to
\htmladdnormallink{Journal of Integer Sequences home page}{http://www.cs.uwaterloo.ca/journals/JIS/}.
\vskip .1in
\end{document}