Two classes of modular $p$-Stanley sequences
Consider a set $A$ with no $p$-term arithmetic progressions for $p$ prime. The $p$-Stanley sequence of a set $A$ is generated by greedily adding successive integers that do not create a $p$-term arithmetic progression. For $p>3$ prime, we give two distinct constructions for $p$-Stanley sequences which have a regular structure and satisfy certain conditions in order to be modular $p$-Stanley sequences, a set of particularly nice sequences defined by Moy and Rolnick which always have a regular structure.Odlyzko and Stanley conjectured that the 3-Stanley sequence generated by $\{0,n\}$ only has a regular structure if $n=3^k$ or $n=2\cdot 3^k$. For $p>3$ we find a substantially larger class of integers $n$ such that the $p$-Stanley sequence generated from $\{0,n\}$ is a modular $p$-Stanley sequence and numerical evidence given by Moy and Rolnick suggests that these are the only $n$ for which the $p$-Stanley sequence generated by $\{0,n\}$ is a modular $p$-Stanley sequence. Our second class is a generalization of a construction of Rolnick for $p=3$ and is thematically similar to the analogous construction by Rolnick.
\section{Introduction}

A set is called \textit{$p$-free} if it contains no $p$-term arithmetic progression. The study of $p$-free sets has been of much interest. Szekeres conjectured that for $p$ an odd prime, the maximum number of elements in a $p$-free subset of $\{0,1,\ldots,n-1\}$ grew as $n^{\log_p(p-1)}$ \cite{erd2}. This conjecture has since been disproved. The lower bound for $p=3$ is $n^{1-o(1)}$ with the best known bound due to Elkin \cite{lower}. The upper bound lies at $O(n(\log\log n)^5/\log n)$ due to Sanders \cite{upper}.

Szekeres's conjecture is based on the fact that starting with 0 and greedily adding each subsequent integer that does not create a $p$-term arithmetic progression will produce exactly the numbers that have no digit of $(p-1)$ in their base $p$ expansion. Despite the fact that this construction does not produce maximally dense sets, it still exhibits many interesting structures. In 1978, Odlyzko and Stanley generalized this construction to arbitrary sets \cite{stan}.

\begin{defn}
For $p$ an odd prime, the \textbf{$p$-Stanley sequence} $S_p(A)$ generated by a $p$-free subset of the nonnegative integers $A=\{a_1,\ldots,a_k\}$ with $a_1<a_2<\cdots<a_k$ is constructed such that if $a_1<a_2<\cdots<a_n$ have been defined, then $a_{n+1}>a_n$ is defined to be the smallest integer such that the set $\{a_1,a_2,\ldots,a_{n+1}\}$ is $p$-free.
\end{defn}

Odlyzko and Stanley noticed that for some sets $A$, the Stanley sequence $S_3(A)$ displays a regular pattern in terms of the ternary representations of its terms and these sequences grow as $n^{\log_23}$. In particular, they explicitly computed $S_3(0,3^k)$ and $S_3(0,2\cdot3^k)$ and showed that these sequences satisfy the above properties. However, for other values of $n$, the sequence $S_3(0,n)$ seems to grow chaotically and at the rate $n^2/\log n$.

Odlyzko and Stanley provided a heuristic argument why a randomly chosen sequence should grow at this rate and conjectured that these two behaviors are the only possible ones. Further work on the growth of chaotic $p$-Stanley sequences for $p>3$ can be found in \cite{t2}. This leads to the following conjecture.

\begin{conj}[Based on \cite{stan},\cite{t2}]
A $p$-Stanley sequence $a_1,a_2,\ldots$ with $p$ an odd prime satisfies either:
\begin{itemize}
\item[Type I:]$a_n=\Theta(n^{\log_{(p-1)}p})$
\item[Type II:]$a_n=\Theta\left(n^{(p-1)/(p-2)}/(\log n)^{1/(p-2)}\right)$
\end{itemize}
\end{conj}

Though we now know many more $A$ such that $S_3(A)$ is Type I, almost no progress has been made since 1978 on showing even the $p=3$ case of this conjecture. In fact, to this date, no Stanley sequence has been proven to be Type II.

In this paper we prove an analogous result to Odlyzko and Stanley's original result. For each $p>3$ prime, we find a set $A_p$ such that for $n\in A_p$, the $p$-Stanley sequence $S_p(0,n)$ is modular, a stronger condition than Type I, which was developed by Moy and Rolnick in \cite{mod}.

We find that for $p>3$ there are many more $n$ such that $S_p(0,n)$ is modular than in the $p=3$ case. Furthermore, numerical evidence suggests that we have found all numbers $n$ with this property. It is still an interesting open problem to show that the other (or any) sets generate Type II Stanley sequences.

\section{Definitions}

This section provides the definitions and basic results on modular $p$-Stanley sequences necessary to prove our result. For further exposition, see \cite{mod}.

\begin{defn}
A set $A$ is said to \textit{$p$-cover} $x$ if there exists $x_1,x_2,\ldots,x_{p-1}\in A$ such that $x_1<x_2<\cdots<x_{p-1}<x$ is an arithmetic progression.
\end{defn}

\begin{prop}
\label{thm:alt}
The $p$-Stanley sequence $S_p(A)$ is the unique sequence that starts with $A$, is $p$-free, and covers all $x\not\in S_p(A)$ with $x>\max(A)$.
\end{prop}

\begin{proof}
This is easy to see since for each $x>\max(A)$, it is either in $S_p(A)$ if it keeps the sequence $p$-free, or not in $S_p(A)$ if it doesn't -- because it would be the largest term of a $p$-term arithmetic progression in $S_p(A)$.
\end{proof}

\begin{defn}
A set $A\subseteq\{0,1,\ldots,N-1\}$ is said to \textit{$p$-cover $x$ mod $N$} if there exists $x_1,x_2,\ldots,x_{p-1}\in A$ such that $x_1<x_2<\cdots<x_{p-1}<x$ or $x_1<x_2<\cdots<x_{p-1}<x+N$ is an arithmetic progression.
\end{defn}

\begin{defn}
A set $A\subseteq\{0,1,\ldots,N-1\}$ is a \textit{modular $p$-free set mod $N$} if it contains 0, is $p$-free mod $N$, and $p$-covers all $x$ with $0\leq x<N$ and $x\not\in A$. A $p$-Stanley sequence is modular if it can be written as $S_p(A)$ for $A$ a modular $p$-free set.
\end{defn}

We will refer to $p$-covering and modular $p$-free simply as covering and modular when $p$ is obvious. We write $A+B$ for $\{a+b\mid a\in A, b\in B\}$ and $c\cdot A$ for $\{c\cdot a\mid a\in A\}$. The following is the main theorem on modular $p$-Stanley sequences proved in \cite{mod}. It implies that a modular Stanley sequence grows asymptotically as $S_p(0)$. 

\begin{thm}[Theorem 6.5 in \cite{mod}]
If $A$ is a modular $p$-free set mod $N$, then $S_p(A)=A+N\cdot S_p(0)$.
\end{thm}

\begin{cor}
Any modular $p$-Stanley sequence exhibits Type I growth.
\end{cor}

\section{Results}

In this section, \textit{digits} refers to the digits of a number in base $p$.

\begin{defn}
Define the set $A_p$ by $n\in A_p$ if and only if $p^{k-1}<n\leq p^k$ with $p^k-n\in S_p(0)$ and $p^k-n<(p-2)p^{k-1}$.
\end{defn}

This is equivalent to saying that $p^k-n$ must have first digit less than $p-2$ and all other digits not equal to $p-1$.

\begin{defn}
Write $S_p^k$ for the set $\{x\mid x\in S_p(0),x<p^k\}$.
\end{defn}

It is known that $S_p^k$ is $p$-free mod $p^k$ and that it covers $\{0,1,\ldots,p^k-1\}\setminus S_p^k$. For a proof, see Lemma 6.4 in \cite{mod}.

\begin{defn}
For $0\leq x<p^k$ with $x\not\in S_p^k$, write $x=\sum_i d_ip^i$. Define $S=\{i\mid d_i=p-1\}$. The \textbf{canonical covering} of $x$ is $x_j=\sum_i d_i^{(j)}p^i$ for $0\leq j<p-1$ where $d_i^{(j)}=d_i$ if $j\not\in S$ and $d_i^{(j)}=j$ otherwise.
\end{defn}

The canonical covering is contained in $S_p^k$ and as suggested by its name, $p$-covers $x$. An example is shown in Table \ref{fig:can}.

Now we prove our main result. Showing that a $p$-Stanley sequence is modular requires guessing the modular set that generates it and then proving that the set is modular and does in fact generate the right sequence. We show that for $n\in A_p$, the sequence $S_p(0,n)$ is generated by a set which is almost equal to $S_p^k$ translated by $n$ and that the modifications we make to it do not change the properties we require of it. 

\begin{thm}
For $p>3$ a prime, $S_p(0,n)$ is modular for all $n\in A_p$.
\end{thm}

\begin{proof}
Say $p^{k-2}<n\leq p^{k-1}$. Define $A=\{0\}\cup(n+S_p^k)\setminus\{p^{k-1}(p-1)\}$. We will show that $S_p(0,n)=S_p(A)$ and that $A$ is modular mod $p^k$.

The first requires showing that $A$ is $p$-free and covers all $n<x<p^k$ with $x\not\in A$ by Proposition \ref{thm:alt}. The second requires showing that $A$ is $p$-free mod $p^k$ and covers all $0\leq x<p^k$ with $x\not\in A$ mod $p^k$.

Note that for $0<x<n$, the set $A$ cannot $p$-cover $x$, so it must $p$-cover $x+p^k$ instead. Thus it is sufficient to show that $A$ is $p$-free mod $p^k$ and covers all $n<x<p^k+n$ with $x\not\in A$ and $x\neq p^k$.

Define $ A'=-n+A=\{-n\}\cup S_p^k\setminus\{p^{k-1}(p-1)-n\}$. We will show that $A'$ is $p$-free mod $p^k$ and covers all $0\leq x<p^k$ with $x\not\in A'$ and $x\neq p^k-n$.

\textbf{$A'$ is $p$-free mod $p^k$:} Since $S_p^k$ is $p$-free mod $p^k$, any arithmetic progression must contain $-n$. Furthermore, for any arithmetic progression $\{a_i\}$ mod $p^k$, it must be the case that $\{a_i\pmod{p^{k-1}}\}$ is an arithmetic progression mod $p^{k-1}$. However, by the definition of $A_p$, we know that $p^{k-1}-n\in S_p^k$, so the progression $\{a_i\pmod{p^{k-1}}\}$ is in fact an arithmetic progression mod $p^{k-1}$ in $S_p^{k-1}$, so it must be the constant arithmetic progression.

Therefore $a_0\equiv a_1\equiv\cdots\equiv a_{p-1}\equiv -n \pmod{p^{k-1}}$. Then the only possible arithmetic progression mod $p^k$ in $A'$ is $ip^{k-1}-n$ for $0\leq i <p$, but since $(p-1)p^{k-1}-n\not\in A'$, in fact $A'$ is $p$-free mod $p^k$.

\textbf{$A'$ covers its complement:} If $x=p^{k-1}(p-1)-n$, then $x$ is covered by $\{ip^{k-1}-n\}$ for $0\leq i<p-1$. Otherwise, $x\not\in S_p^k$. We already know that $x$ is covered by its canonical covering, so the only cases we have to consider are those in which the canonical covering of $x$ contains $p^{k-1}(p-1)-n$.

Write \[p^{k-1}(p-1)-n=\sum_{i=0}^{k-1}d_ip^i,\]where $0\leq d_i<p$. Our hypotheses on $A_p$ tell us that $d_{k-1}=p-2$ and $d_{k-2}<p-2$ and $d_i\neq p-1$ for all $i$.

For $S\subseteq\{0,1,\ldots,k-1\}$ define \[x(S)=\sum_{i=0}^{k-1}d_i(S)p^i,\] where $d_i(S)=d_i$ if $i\not\in S$ and $d_i(S)=p-1$ otherwise. The only numbers that contain $p^{k-1}(p-1)-n$ in their canonical covering are those that can be expressed as $x(S)$ where $|S|>0$ and $d_i$ is constant for all $i\in S$.

Note that $S\neq\{k-1\}$ since then $x(S)=p^k-n$. Furthermore, the fact that $d_{k-1}=p-2> d_{k-2}$ implies that $\{k-1,k-2\}\not\subseteq S$.

We will use the following notation. Let $j$ be the largest element of $S\setminus\{k-1\}$. The above reasoning shows that $j$ exists and that if $j=k-2$, then $k-1\not\in S$. We know that $d_j(S)=p-1$. Define \[a=d_j,\] and \[b=d_{j+1}=d_{j+1}(S).\] We know that $0\leq a,b<p-1$. We now have four cases.

\begin{table}
\centering
\begin{subtable}[b]{0.4\textwidth}
\centering
\begin{tabular}{ccccccc}
11 & 6 & 12 & 12 & 0 & 3 & 12 \\
11 & 6 & 11 & 11 & 0 & 3 & 11\\
11 & 6 & 10 & 10 & 0 & 3 & 10\\
11 & 6 & 9 & 9 & 0 & 3 & 9\\
11 & 6 & 8 & 8 & 0 & 3 & 8\\
11 & 6 & 7 & 7 & 0 & 3 & 7\\
11 & 6 & 6 & 6 & 0 & 3 & 6 \\
11 & 6 & 5 & 5 & 0 & 3 & 5 \\
11 & 6 & 4 & 4 & 0 & 3 & 4 \\
11 & 6 & 3 & 3 & 0 & 3 & 3 \\
11 & 6 & 2 & 2 & 0 & 3 & 2 \\
11 & 6 & 1 & 1 & 0 & 3 & 1 \\
11 & 6 & 0 & 0 & 0 & 3 & 0 \\
\end{tabular}
\caption{The canonical covering}
\label{fig:can}
\end{subtable}
\qquad
\begin{subtable}[b]{0.4\textwidth}
\centering
\begin{tabular}{ccccccc}
11 & 6 & 12 & 12 & 0 & 3 & 12 \\
10 & 6 & 11 & 11 & 0 & 3 & 11\\
9 & 6 & 10 & 10 & 0 & 3 & 10\\
8 & 6 & 9 & 9 & 0 & 3 & 9\\
7 & 6 & 8 & 8 & 0 & 3 & 8\\
6 & 6 & 7 & 7 & 0 & 3 & 7\\
5 & 6 & 6 & 6 & 0 & 3 & 6 \\
4 & 6 & 5 & 5 & 0 & 3 & 5 \\
3 & 6 & 4 & 4 & 0 & 3 & 4 \\
2 & 6 & 3 & 3 & 0 & 3 & 3 \\
1 & 6 & 2 & 2 & 0 & 3 & 2 \\
0 & 6 & 1 & 1 & 0 & 3 & 1 \\
$(-1)$ & 6 & 0 & 0 & 0 & 3 & 0 \\
\end{tabular}
\caption{An alternative covering}
\end{subtable}
\caption{An example of Case 1 with $p=13$. The first line gives the base-13 representation of $x(S)$ and the subsequent lines give the base-13 representations of the sequence which covers it. The canonical covering of $x(S)$ containing $p^{k-1}(p-1)-n$ and an alternative covering which contains $-n$ instead.}
\label{fig:c1}
\end{table}

\textbf{Case 1:} $a=0$

Let $\Delta=\sum_{i\in S}p^i$. Then $\{p^{k-1}(p-1)-n+i\Delta\}$ for $0\leq i<p-1$ is the canonical covering of $x(S)$. However $\{ip^{k-1}-n+i\Delta\}$ for $0\leq i<p-1$ also covers $x(S)$. Table \ref{fig:c1} shows an example of both of these sequences.

We can check that all of these terms are in $A'$. Since $p^{k-1}(p-1)-n+i\Delta\in S_p^k$ with first digit $p-2$, then $ip^{k-1}-n+i\Delta$ is the same except that it has first digit 0 through $p-2$ for $0<i<p-1$. Finally, for $i=0$, then $ip^{k-1}-n+i\Delta=-n\in A'$.

\FloatBarrier

\begin{table}
\centering
\begin{tabular}{ccc|ccccc|cc}
12 & 6 & 3 & 6 & 4 & 5 & 4 & 12 & 10 & 12 \\
11 & 6 & 3 & 5 & 10 & 11 & 11 & 6 & 10 & 11\\
10 & 6 & 3 & 5 & 4 & 5 & 5 & 0 & 10 & 10\\
9 & 6 & 3 & 4 & 10 & 11 & 11 & 7 & 10 & 9\\
8 & 6 & 3 & 4 & 4 & 5 & 5 & 1 & 10 & 8\\
7 & 6 & 3 & 3 & 10 & 11 & 11 & 8 & 10 & 7\\
6 & 6 & 3 & 3 & 4 & 5 & 5 & 2 & 10 & 6\\
5 & 6 & 3 & 2 & 10 & 11 & 11 & 9 & 10 & 5\\
4 & 6 & 3 & 2 & 4 & 5 & 5 & 3 & 10 & 4\\
3 & 6 & 3 & 1 & 10 & 11 & 11 & 10 & 10 & 3\\
2 & 6 & 3 & 1 & 4 & 5 & 5 & 4 & 10 & 2\\
1 & 6 & 3 & 0 & 10 & 11 & 11 & 11 & 10 & 1\\
0 & 6 & 3 & 0 & 4 & 5 & 5 & 5 & 10 & 0\\
\end{tabular}
\caption{An example of Case 2 with $p=13$. An alternative covering of $x(S)$ with common difference $1000666601_{13}$. Outside of the vertical lines, the covering matches the canonical covering.}
\label{fig:c2}
\end{table}

\textbf{Case 2:} $0<a<p-1$ and $0\leq b<(p-3)/2$

Let $j'>j$ be the smallest integer such that $d_{j'}\geq(p-1)/2$. Note that $j'$ exists since $d_{k-1}\geq p-2\geq (p-1)/2$. Table \ref{fig:c2} shows an example of this case with the range $j$ through $j'$ marked off.

Now let
\begin{align*}
\Delta&=\sum_{i=j}^{j'-1}p^i(p-1)/2+\sum_{i\in S\setminus\{j,j+1,\ldots,j'\}}p^i,\\
&=(p^{j'}-p^j)/2+\sum_{i\in S\setminus\{j,j+1,\ldots,j'\}}p^i.
\end{align*}
Consider the arithmetic progression $\{x(S)-i\Delta\}$ for $0<i\leq p-1$. We claim this is contained in $A'$.

We can compute the digits of each of these numbers. Say $x(S)-i\Delta=\sum_l d_l^{(i)}p^l$. For $l\not\in\{j,j+1,\ldots,j'\}$, then $d_l^{(i)}$ matches the canonical covering: $d_l^{(i)}=d_l$ if $i\not\in S$, otherwise $d_l^{(i)}=p-1-i$.

Now it is not too hard to check that $d_{j'}^{(i)}=d_{j'}-\lceil i/2\rceil$. For $j+1<l<j'$, the digit $d_{l}^{(i)}=d_l$ for $i$ even and $d_l^{(i)}=d_l+(p-1)/2$ for $i$ odd. The digit $d_{j+1}^{(i)}=d_l+1$ for $i>0$ even and $d_{j+1}^{(i)}=d_l+1+(p-1)/2$ for $i$ odd. Finally, $d_j^{(i)}=i/2-1$ for $i>0$ even and $d_j^{(i)}=(p-1)/2+(i-1)/2$ for $i$ odd. 

Lastly, we check that all of these terms are in $A'$. The $j$th digit cycles through each value, so it is never equal to $p-1$ again. Since $d_{j'}\geq(p-1)/2$, it never goes below 0 and even if $d_{j'}=p-1$, it immediately is decreased by 1 so $d_{j'}^{(i)}<p-1$ for $i>0$. Since $d_l<(p-1)$/2 for $j<l<j'$, neither of the two values that this digit takes is $p-1$. Finally, the $j+1$st digit only takes on 3 values, none of which are $p-1$ since $d_{j+1}=b<(p-3)/2$. Furthermore, $d_{j+1}^{(i)}\neq d_{j+1}$ for $i>0$. Since this digit never takes on its original value again, none of the terms in this sequence are $p^{k-1}(p-1)-n$.

\begin{table}
\centering
\begin{tabular}{c|cc|cccc}
11 & 6 & 12 & 12 & 0 & 3 & 12\\
11 & 6 & 7 & 11 & 0 & 3 & 11\\
11 & 6 & 2 & 10 & 0 & 3 & 10\\
11 & 5 & 10 & 9 & 0 & 3 & 9\\
11 & 5 & 5 & 8 & 0 & 3 & 8\\
11 & 5 & 0 & 7 & 0 & 3 & 7\\
11 & 4 & 8 & 6 & 0 & 3 & 6 \\
11 & 4 & 3 & 5 & 0 & 3 & 5 \\
11 & 3 & 11 & 4 & 0 & 3 & 4 \\
11 & 3 & 6 & 3 & 0 & 3 & 3 \\
11 & 3 & 1 & 2 & 0 & 3 & 2 \\
11 & 2 & 9 & 1 & 0 & 3 & 1 \\
11 & 2 & 4 & 0 & 0 & 3 & 0 \\
\end{tabular}
\caption{An example of Case 3 with $p=13$. An alternative covering of $x(S)$ with common difference $51001_{13}$. Outside of the vertical lines, the covering matches the canonical covering. To ensure that $p^{k-1}(p-1)-n$ is not contained in this covering, we need $d=5\nmid p-a-1$.}
\label{fig:c3}
\end{table}

\textbf{Case 3:} $0<a<p-1$ and $(p-3)/2\leq b<p-1$ and $(a,b,p)\neq(2,1,5)$

We claim we can find $1\leq d\leq b+1$ such that $d\nmid p-a-1$ given the conditions on this case. If $p>5$, we will show below (Lemma \ref{thm:lem}) that $\lcm(1,2,\ldots,(p-1)/2)\geq p-1$, so some number in this range must not divide $p-a-1<p-1$. If $p=5$, we can use $d=2$ unless $p-a-1=4-a=2$. In the case that $p=5$ and $a=2$, we can use $d=3$ if $b\geq 2$.

Let \[\Delta=dp^j+\sum_{i\in S\setminus\{j\}}p^i.\] Then consider the arithmetic progression $\{x(S)-i\Delta\}$ for $0<i\leq p-1$. We claim this is contained in $A'$.

None of the digits of $x(S)-i\Delta$ are equal to $p-1$ except for possible the $j$th and $j+1$st digits. The $j$th digit decreases by $d\pmod{p}$ so it only takes on the value $p-1$ when $i=0$. Furthermore, the $j$th digit ``borrows'' from the $j+1$st digit exactly $d-1$ times, so since $p-1>b\geq(p-3)/2\geq d-1$, the $j+1$st digit never takes on the value $p-1$ and never ``borrows'' from the $j+2$nd digit.

Finally, the only problem is if one of the terms in this arithmetic progression is equal to $p^{k-1}(p-1)-n$. This must occur before the $j+1$st digit has changed its value from $d_{j+1}$. In this range, the $j$th digit has value $d_j(S)-id=(p-1)-id$. If $(p-1)-id=a$, then $d\mid p-a-1$, a contradiction.

Thus this arithmetic progression is contained in $A'$, as desired.

\FloatBarrier

\begin{table}
\centering
\begin{subtable}[b]{0.4\textwidth}
\centering
\begin{tabular}{ccccc|ccc|c}
3 & 1 & 0 & 2 & 3 & 1 & 1 & 4 & 2\\
3 & 1 & 0 & 2 & 3 & 1 & 0 & 1 & 2\\
3 & 1 & 0 & 2 & 3 & 0 & 3 & 3 & 2\\
3 & 1 & 0 & 2 & 3 & 0 & 2 & 0 & 2\\
3 & 1 & 0 & 2 & 3 & 0 & 0 & 2 & 2\\
\end{tabular}
\caption{$d_{j+2}\geq1$}
\label{fig:c4a}
\end{subtable}
\qquad
\begin{subtable}[b]{0.4\textwidth}
\centering

\begin{tabular}{cc|cccccc|c}
3 & 1 & 3 & 0 & 1 & 0 & 1 & 4 & 2\\
3 & 1 & 2 & 3 & 2 & 3 & 0 & 1 & 2\\
3 & 1 & 2 & 1 & 0 & 0 & 3 & 3 & 2\\
3 & 1 & 1 & 3 & 2 & 3 & 2 & 0 & 2\\
3 & 1 & 1 & 1 & 0 & 1 & 0 & 2 & 2\\
\end{tabular}
\caption{$d_{j+2}=0$}
\label{fig:c4b}
\end{subtable}
\caption{An example of Case 4. An alternate covering for $x(S)$ in the cases that $d_{j+2}\geq1$ and $d_{j+2}=0$.}
\label{fig:c4}
\end{table}

\textbf{Case 4:} $a=2$, $b=1$, and $p=5$.

The case is similar to Case 2. Note that for $j<j'<k$, it is not the case that $j'\in S$, since by definition, the only possibility is $j'=k-1$, but $\{j,k-1\}\subseteq S$ would imply that $d_{j}=d_{k-1}$ and $d_j=a=2$ while $d_{k-1}=p-2=3$.

Also note that $j+1\neq k-1$ since $d_{k-1}=3\neq1=d_{j+1}$. If $p-1>d_{j+2}\geq 1$, we will use\[\Delta=5^{j+1}+3\cdot5^j+\sum_{i\in S\setminus\{j\}}5^i.\]

It is easy to check that $\{x(S)-i\Delta\}$ for $0<i\leq 4$ is in $A'$. See Table \ref{fig:c4a} for the computation.

Otherwise, $d_{j+2}=0$. Let $j'>j+2$ be the smallest integer such that $d_{j'}\geq 2$. This exists for the same reason as in Case 2.

Now let \begin{align*}
\Delta&=\left(\sum_{i=j+2}^{j'-1}2\cdot5^i\right)+5^{j+1}+3\cdot5^j+\sum_{i\in S\setminus\{j,j+1,\ldots,j'\}}5^i,\\
&=(5^{j'}-5^{j+2})/2+5^{j+1}+3\cdot5^j+\sum_{i\in S\setminus\{j,j+1,\ldots,j'\}}5^i.
\end{align*}

Now we cover $x(S)$ by $\{x(S)-i\Delta\}$ for $0<i\leq 4$. As in Case 2, this covering is in $A'$. An example can be found in Table \ref{fig:c4b}.
\end{proof}

\begin{lem}
If $p>5$ is prime, then $\lcm(1,2,\ldots,(p-1)/2)\geq p-1$.
\label{thm:lem}
\end{lem}

\begin{proof}
Say $p-1=\prod_i p_i^{e_i}$. If $p-1$ is not a prime power, then $p_i^{e_i}\in\{1,\ldots,(p-1)/2\}$ for all $i$. Otherwise, since $p$ is odd, we can write $p-1=2^k$. Then since $k>2$, then $2^{k-1},3\in\{1,2,\ldots,(p-1)/2\}$ and so the $\lcm$ is at least $3\cdot2^{k-1}\geq 2^k=p-1$.
\end{proof}

\section*{Acknowledgments}

This research was conducted at the University of Minnesota Duluth REU and was supported by NSF grant 1358695 and NSA grant H98230-13-1-0273. The author thanks Joe Gallian for suggesting the problem and Ben Gunby and Levent Alpoge for helpful comments on the manuscript.


2015-06-29T02:02:28.000
1506
1506.07941
en
https://arxiv.org/abs/1506.07941
Consider a set $A$ with no $p$-term arithmetic progressions for $p$ prime. The $p$-Stanley sequence of a set $A$ is generated by greedily adding successive integers that do not create a $p$-term arithmetic progression. For $p>3$ prime, we give two distinct constructions for $p$-Stanley sequences which have a regular structure and satisfy certain conditions in order to be modular $p$-Stanley sequences, a set of particularly nice sequences defined by Moy and Rolnick which always have a regular structure.Odlyzko and Stanley conjectured that the 3-Stanley sequence generated by $\{0,n\}$ only has a regular structure if $n=3^k$ or $n=2\cdot 3^k$. For $p>3$ we find a substantially larger class of integers $n$ such that the $p$-Stanley sequence generated from $\{0,n\}$ is a modular $p$-Stanley sequence and numerical evidence given by Moy and Rolnick suggests that these are the only $n$ for which the $p$-Stanley sequence generated by $\{0,n\}$ is a modular $p$-Stanley sequence. Our second class is a generalization of a construction of Rolnick for $p=3$ and is thematically similar to the analogous construction by Rolnick.
Combinatorics (math.CO)
Two classes of modular $p$-Stanley sequences
Qwen/Qwen-72B
1. YES
2. YES