\documentclass[12pt,reqno]{article}

\usepackage[usenames]{color}
\usepackage{amssymb}
\usepackage{amsmath}
\usepackage{amsthm}
\usepackage{amsfonts}
\usepackage{amscd}
\usepackage{graphicx}
\usepackage{mathtools}
\usepackage[utf8]{inputenc}
\usepackage{caption}
%\captionsetup[table]{skip=10pt plus 0.01pt}

\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{graphics}
\usepackage{latexsym}
\usepackage{epsf}
\usepackage{breakurl}

\setlength{\textwidth}{6.5in}
\setlength{\oddsidemargin}{.1in}
\setlength{\evensidemargin}{.1in}
\setlength{\topmargin}{-.1in}
\setlength{\textheight}{8.4in}

\newcommand{\seqnum}[1]{\href{https://oeis.org/#1}{\rm \underline{#1}}}
\def\modd#1 #2{#1\ \mbox{\rm (mod}\ #2\mbox{\rm )}}
\DeclareMathOperator{\lcm}{lcm}
\DeclareMathOperator{\sign}{sign}
\DeclareMathOperator{\ind}{ind}
\usepackage[normalem]{ulem}
\usepackage{longtable}
\usepackage[shortlabels]{enumitem}
\setlist[enumerate, 1]{1\textsuperscript{o}}

\begin{document}

\begin{center}
\epsfxsize=4in
\leavevmode\epsffile{logo129.eps}
\end{center}

\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}


\begin{center}
\vskip 1cm{\LARGE\bf Appearance of Primes in Fourth-Order \\
\vskip .1in
Odd Divisibility Sequences
}
\vskip 1cm
\large
E.~L.~Roettger\\
Department of General Education \\
Mount Royal University\\
4825 Mount Royal Gate SW\\
Calgary, AB T3E 6K6\\
Canada \\
\href{mailto:eroettger@mtroyal.ca}{\tt eroettger@mtroyal.ca} \\
\ \\
H.~C.~Williams \\
Department of Mathematics and Statistics \\ 
University of Calgary\\
2500 University Drive NW\\
Calgary, AB  T2N 1N4 \\
Canada  \\
\href{mailto:hwilliam@ucalgary.ca}{\tt hwilliam@ucalgary.ca} 
\end{center}

\vskip .2 in


\begin{abstract}
Let $(A_n)$ denote any odd, non-degenerate, non-null, fourth-order linear divisibility sequence and let $p$ be any prime such that $p$ divides some term $A_n$ ($n>1$) of 
$(A_n)$.
In this paper we derive a number of properties of $(A_n)$. 
In particular, we exhibit conditions which guarantee that if $p\mid A_k$, then $\omega \mid k$.
Here $\omega$ ($=\omega(p)$) is the least positive integer $m$ such that $p\mid A_m$.
\end{abstract}

\begin{center}
\emph{Dedicated to the memory of Richard Guy (1916--2020).}
\end{center}

\section{Introduction}\label{Intro}

Although
we use the notation $(T_n)$ to denote the sequence 
\begin{equation*}
\ldots, T_{-n},\ldots, T_{-2}, T_{-1}, T_0, T_1, T_2,\ldots, T_n, \ldots,
\end{equation*}
we will often be concerned in the sequel with terms of $(T_n)$ which have only positive subscripts.
Let $p$, $q\in \mathbb{C}$ and $\alpha$, $\beta$ be the zeros of $x^2-px+q \in \mathbb{C}[x]$.
We define, for any $n \in \mathbb{Z}$, 
\begin{equation*}
u_n=u_n(p,q)=\frac{\alpha^n-\beta^n}{\alpha-\beta}, \quad v_n=v_n(p,q)=\alpha^n+\beta^n.
\end{equation*}
When $p$, $q$ are integers, both $u_n(p,q)$ and $v_n(p,q)$ are integers for all $n\geq 0$ and
when $p$, $q$ are coprime integers are called the Lucas functions.  Note that $u_0=0$, $u_1=1$, $v_0=2$, $v_1=p$.
The Lucas sequences $(u_n(p,q))$, $(v_n(p,q))$ both satisfy the second-order linear recurrence
\[
T_{n+1}=pT_n-qT_{n-1}.
\]
Also, $m \mid n \Rightarrow u_m(p,q)\mid u_n(p,q)$.

\begin{definition}
A \emph{linear recurrence sequence of order $l$} over the integers is a sequence $(T_n)$, where we have
\begin{equation*}
T_{n+l}=A_1T_{n+l-1}+A_2T_{n+l-2}+A_3T_{n+l-3}+ \ldots +A_lT_{n}
\end{equation*}
and $T_0$,  $T_1$,  $T_2$, $\ldots$ ,  $T_{l-1}$,  $A_1$,  $A_2$,  $A_3$, $\ldots$ , $A_l$ are given fixed integers, with $A_l\not=0$.
Furthermore, if $T_m\mid T_n$ whenever $m\mid n$, then $(T_n)$ is said to be a \emph{$l^{\rm th}$
order linear divisibility sequence} (LDS).  
\end{definition}
\noindent Thus, we see that the Lucas sequence $(u_n(p,q))$ is a second-order LDS.

In his investigation of the problem of primality testing, Lehmer \cite{Leh30} introduced the functions 
$(\bar{u}_n(r,q))$, $(\bar{v}_n(r,q))$, where $r$, $q$ are coprime integers.  These are defined by
\begin{align*}
&\bar{u}_n(r,q)=
\begin{dcases}
        u_n(\sqrt{r},q), & \mbox{if $2\nmid n$}; \\
        \frac{u_n(\sqrt{r},q)}{\sqrt{r}}, & \mbox{if $2\mid n$},\\
    \end{dcases}\\
&\bar{v}_n(r,q)=\begin{dcases}
        v_n(\sqrt{r},q), & \mbox{if $2\mid n$}; \\
       \frac{v_n(\sqrt{r},q)}{\sqrt{r}}, & \mbox{if $2\nmid n$}.\\
    \end{dcases}
\end{align*}
Notice that for $n$ positive or negative
\begin{equation*}
\bar{u}_{-n}(r,q)=-q^n\bar{u}_n(r,q), \quad \bar{v}_{-n}(r,q)=q^n\bar{v}_n(r,q).
\end{equation*}
The sequences $(\bar{u}_n(r,q))$, $(\bar{v}_n(r,q))$ are comprised of integers for all $n\geq 0$ and both satisfy the fourth-order linear recurrence 
\begin{equation}\label{rqfourth}
T_{n+4}=(r-2q)T_{n+2}-q^2T_n.
\end{equation}
Here we have $\bar{u}_0=0$, $\bar{u}_1=1$, $\bar{u}_2=1$, $\bar{u}_3=r-q$, $\bar{v}_0=2$, $\bar{v}_1=1$, $\bar{v}_2=r-2q$, $\bar{v}_3=r-3q$.
Furthermore, $(\bar{u}_n(r,q))$, is a divisibility sequence; hence $(\bar{u}_n(r,q))$ is a fourth-order LDS.
We also know from results in \cite{Leh30} that $\bar{u}_{2n}(r,q)=\bar{u}_n(r,q)\bar{v}_n(r,q)$ 
and that $\bar{v}_n(r,q)\mid \bar{v}_{kn}(r,q)$ when $k$ is odd.

Recently, by making use of the theory of generalized Vandermonde determinants, Barbero \cite{Bar17}
was able to give an elementary proof of an important result of B\'ezivin, 
Peth\"o, and van der Poorten \cite{BPP90}
in the specific case where the \emph{characteristic polynomial} $F(x)$ $(=x^l-A_1x^{l-1}-A_2x^{l-2}-\ldots-A_l)$
of $(T_n)$ has a non-zero discriminant, but his overall result is much more general than this.
\begin{definition}
We say that the sequence $(T_n)$ is \emph{degenerate} if $\alpha_i/\alpha_j$ is a root of unity for any two distinct roots 
$\alpha_i$, $\alpha_j$ of the characteristic polynomial $F(x)$.
\end{definition}
\begin{theorem}\label{nondeg1}
If $(T_n)$ is a non-degenerate LDS of order $l$ whose characteristic polynomial has distinct roots 
 $\alpha_1$, $\ldots$ ,$\alpha_l$, then, for all $n\geq 0$, we must have 
$T_n\mid r_n$, where
\[
r_n=\prod (\alpha_i^n-\alpha_j^n)/(\alpha_i-\alpha_j)
\]
and the product is taken over all $i$ and $j$ such that $1\leq i < j\leq l$.
\end{theorem}
Theorem \ref{nondeg1} was used by Abrate et al.~\cite{ABCM17} to prove the following result.
\begin{theorem}\label{nondeg2}
If $(T_n)$ is a non-degenerate LDS of order $4$, then its characteristic polynomial must be the form
\[
x^4-Px^3+(R+2Q)x^2-PQx+Q^2,
\]
for some integers $P$, $Q$ and $R$.
\end{theorem}
\noindent The above polynomial is the characteristic polynomial for the Lehmer functions for $P=0$, $Q=q$, $R=-r$.

\begin{definition}
If $(T_n)$ is a linear recurrence sequence, we say that an integer $m$ $(m>1)$ is a \emph{null divisor} of $(T_n)$ if, 
for some minimal $h>0$, we have $m\mid T_n$ for all $n\geq h$.
\end{definition}
\begin{definition}
  If $(T_n)$ has a null divisor, it is said to be a \emph{null sequence}.
  \end{definition}
In what follows we shall be concerned only with \emph{non-null sequences}.  For example, the condition $\gcd(p,q)=1$ ensures that both
$(u_n(p,q))$ and $(v_n(p,q))$ are non-null sequences.  Similarly, the condition that $\gcd(r,q)=1$ ensures that both 
$(\bar{u}_n(r,q))$ and $(\bar{v}_n(r,q))$ are non-null sequences.
Also, our attention will be confined to fourth-order sequences $(T_n)$ which are both non-degenerate and non-null.  
Furthermore, as was done in Williams and Guy \cite{WG15}, we will only consider the case of $l=4$ and $(T_n)$ a divisibility sequence.  
By Theorem \ref{nondeg2}, we need only consider 
\begin{equation}\label{char}
F(x)=x^4-P_1x^3+(P_2+2Q)x^2-P_1Qx-Q^2,
\end{equation}
where $P_1$, $P_2$ and $Q$ are fixed integers, i.e.,
\begin{equation}\label{4Tn}
T_{n+4}=P_1 T_{n+3}-(P_2+2Q)T_{n+2}+P_1QT_{n+1}-Q^2T_n.
\end{equation}
Note that if $D$ $(\not=0)$ is the discriminant of $F(x)$, then 
\begin{equation}\label{D}
D=E\Delta^2Q^2,
\end{equation}
where 
\begin{equation}\label{theDelta}
\Delta=P_1^2-4P_2, \quad E=(P_2+4Q)^2-4QP_1^2. 
\end{equation}
 See, for example, Williams and Guy \cite{WG11}.
  Let $\rho_1$, $\rho_2$ be the roots of the quadratic polynomial $x^2-P_1x+P_2=0$.  Since
 \begin{equation*}
 F(x)=f_1(x)f_2(x),
 \end{equation*}
 where $f_i(x)=x^2-\rho_ix+Q$, we may assume that if $\alpha_1$, $\beta_1$, $\alpha_2$, $\beta_2$ denote the four distinct roots of $F(x)$, then
 \begin{equation}\label{Qab}
\alpha_1\beta_1=\alpha_2\beta_2=Q.
\end{equation}

\begin{definition}
We say that if $(T_n)$ satisfies (\ref{4Tn}), then $(T_n)$ 
is  \emph{even} when
$T_{-n}=T_n/Q^n$ and 
$(T_n)$ is \emph{odd} when $T_{-n}=-T_n/Q^n$ for all $n$.
\end{definition}
\noindent Certainly, if $(T_n)$ is odd, we must have $T_0=-T_0/Q^0 \Rightarrow T_0=0$ and 
$Q T_{-1}=-T_1$.  We now show that these two conditions are necessary and sufficient for $(T_n)$ to be odd.
\begin{theorem}\label{odd}
If $T_0=0$, then $(T_n)$ is odd if and only if  $Q T_{-1}=-T_1$.
\end{theorem}
\begin{proof}
If $(T_n)$ is odd, then $Q T_{-1}=-T_1$ from the definition.  Suppose that $Q T_{-1}=-T_1$.
By (\ref{4Tn}) we have
\begin{align*}
T_2 &=P_1T_1-(P_2+2Q)T_0+P_1QT_{-1}-Q^2T_{-2} \\
       &=P_1T_1-0-P_1T_1-Q^2T_{-2}=-Q^2T_{-2}.
\end{align*}
Also,
\begin{equation*}
T_3 =P_1T_2-(P_2+2Q)T_1+P_1QT_{0}-Q^2T_{-1} =P_1T_2-(P_2+Q)T_1
\end{equation*}
and since
\begin{equation*}
T_1=P_1T_0-(P_2+2Q)T_{-1}+P_1QT_{-2}-Q^2T_{-3},
\end{equation*}
we see that
\begin{align*}
-Q^3T_{-3}&=QT_1-(P_2+2Q)T_1+P_1T_2\\
&=P_1T_2-(P_2+2Q)T_1-Q^2T_{-1}=T_3.
\end{align*}
Thus, $T_i=-Q^iT_{-i}$ $(i=0, 1, 2, 3)$.
If we assume that for some $m\geq 0$ we have $T_{m+i}=-Q^{m+i}T_{-(m+i)}$ $(i=0, 1, 2, 3)$
(this is certainly true for $m=0$), we can see that $T_m=-Q^mT_{-m}$,
$T_{m+1+i}=-Q^{m+1+i}T_{-(m+1+i)}$ $(i=0,1,2)$.  We can now use (\ref{4Tn}) to compute 
\begin{equation*}
T_{m+1+3}=-Q^{m+2}(P_1QT_{-(m+3)}-(P_2+2Q)T_{-(m+2)}+P_1T_{-(m+1)}-T_{-m}).
\end{equation*}
Also, by (\ref{4Tn}), we have
\begin{equation*}
T_{-m}=P_1T_{-(m+1)}-(P_2+2Q)T_{-(m+2)}+P_1QT_{-(m+3)}-Q^2T_{-(m+4)}.
\end{equation*}
Putting this value of $T_{-m}$ into the previous result, we get
\begin{equation*}
T_{m+1+3}=T_{m+4}=-Q^{m+4}T_{-(m+4)}=-Q^{m+1+3}T_{-(m+1+3)}.
\end{equation*}
Thus, we find by induction that $T_n=-Q^nT_{-n}$ for all $n\geq 0$.
\end{proof}

If $T_0=P_1=0$ and $T_1=QT_{-1}$, we can show by using the above reasoning that 
\begin{equation*}
Q^nT_{-n}=(-1)^{n-1}T_n.
\end{equation*}
Thus, in this case we see that $T_n$ is neither even nor odd.

We also have the following simple result, which extends an observation in \cite[\S 1]{WG12}.

\begin{proposition}\label{etaTn}
Suppose $(T_n)$ satisfies (\ref{4Tn}).  Let $\eta \in \{1,-1\}$ and 
suppose $T_j^{*}=\eta^{j-1} T_j$ $(j=-1, 0, 1, 2)$.
If $P_1^{*}=\eta P_1$ and 
\begin{equation*}
T_{n+4}^{*}=P_1^{*} T_{n+3}^{*}-(P_2+2Q)T_{n+2}^{*}+P_1^{*}QT_{n+1}^{*}-Q^2T_n^{*},
\end{equation*}
then $T_n^{*}=\eta^{n-1}T_n$ for all $n\geq 1$.
\end{proposition}
\begin{proof}
Follows easily by induction on $n$.
\end{proof}

Suppose that $P_1=0$.
If $(T_n)$ satisfies (\ref{4Tn}), we have
\begin{equation}\label{TnP1=0}
T_{n+4}=-(P_2+2Q)T_{n+2}-Q^2T_n.
\end{equation}
If $(T_n)$ is to be a non-degenerate LDS, we must have
\begin{equation*}
1+QT_{-1}=0\quad \mbox{ or }\quad 1-QT_{-1}=0
\end{equation*}
by results in \cite[\S 3]{WG15}.
In the case of $QT_{-1}=-1$, then
\begin{equation*}
T_n=
\begin{dcases}
      T_2\bar{u}_n(-P_2,Q), & \mbox{if $2\mid n$}; \\
      \bar{u}_n(-P_2,Q),  & \mbox{if $2\nmid n$};\\
    \end{dcases}\\
\end{equation*}
if $QT_{-1}=1$, then
\begin{equation*}
T_n=
\begin{dcases}
      T_2\bar{u}_n(-P_2,Q), & \mbox{if $2\mid n$}; \\
      \bar{v}_n(-P_2,Q),  & \mbox{if $2\nmid n$}.\\
    \end{dcases}\\
\end{equation*}
Note that in either event $(T_n)$ is a divisibility sequence because $(\bar{u}_n(-P_2,Q))$ is a divisibility sequence, 
$\bar{v}_n(-P_2,Q)\mid \bar{v}_{nk}(-P_2,Q)$ when $k$ is odd and 
$\bar{u}_{2n}(-P_2,Q)=\bar{u}_n(-P_2,Q)\bar{v}_n(-P_2,Q)$.

Now if we define $u_n^*=\bar{u}_n(-P_2-4Q,-Q)$, we see that since $-P_2-4Q+2Q=-P_2-2Q$, then $(u_n^*)$ must satisfy (\ref{TnP1=0}).
Also, $u_0^*=0=\bar{u}_0(-P_2,Q)$, $u_1^*=1=\bar{v}_0(-P_2,Q)$, $u_2^*=1=\bar{u}_2(-P_2,Q)$, $u_3^*=-P_2-3Q=\bar{v}_3(-P_2,Q)$.
It follows that if $QT_{-1}=1$, then 
\begin{equation*}
T_n=
\begin{dcases}
      T_2u_n^*, & \mbox{if $2\mid n$}; \\
     u_n^*,  & \mbox{if $2\nmid n$}\\
    \end{dcases}\\
\end{equation*}
and therefore $(T_n)$ is an odd divisibility sequence when we replace $Q$ by $-Q$.

As an example of this consider  $Q=-1$, $P_2=-1$.
We have $T_0=0$, $T_1=1$, $T_2=1$, $T_3=4$,
\begin{equation*}
T_{n+4}=3T_{n+2}-T_n \quad \mbox{(see Sloane \cite[ \seqnum{A005013} ]{Slo20})}
\end{equation*}
and $T_n=T_{-n}$.  Furthermore,
\begin{equation}\label{evenodd}
T_n=
\begin{dcases}
       F_n, & \mbox{if $2\mid n$}; \\
      L_n,  & \mbox{if $2\nmid n$},\\
    \end{dcases}\\
\end{equation}
where $F_n$ and $L_n$ denote the $n^{\rm th}$ Fibonacci and Lucas numbers, respectively.  Also, $T_n=\bar{u}_n(5,1)$.


 
Let $\Delta=S U^2$ and $E=G V^2$, where $S$, $G$, $U$, $V$ are integers and $S$ and $G$ are both non-zero and square-free.
Let $(T_n)$ be any non-null linear divisibility sequence with characteristic polynomial $F(x)$ given by (\ref{char}) with $D\not=0$ and $P_1\not=0$.
In \cite{WG15} the following results are proved:
\begin{itemize}
  \item There is one and only one even $(T_n)$ for any given $F(x)$;
  \item If $S\not=1$ and $G\not=1$, $(T_n)$ is either even or odd;
  \item If $S\not=1$ and $G\not=1$ and $G\not=S$, there can be no odd $(T_n)$;
  \item If $S=1$ and $G\not=1$, then the only possible odd $(T_n)$ is a Lucas sequence $(u_n)$. 
\end{itemize}
We can now partition the possible cases for which $(T_n)$ can be an odd divisibility sequence as follows:
\begin{enumerate}[(i)]
\item $S=G\not=1$;\label{remaining1}
\item $S=1$, $G\not=1$;\label{remaining2}
\item $S\not=1$, $G=1$;\label{remaining3}
\item $S=G=1$.\label{remaining4}
\end{enumerate}
It is not known whether any $(T_n)$ exist in cases \ref{remaining1} and \ref{remaining3}, but none are known and it seems most unlikely in case \ref{remaining3}.

As the problem of determining all even LDSs of order $4$ is solved, we will devote the remainder of the paper to deriving some further properties of odd LDSs of order $4$.
Also,  as a result of our earlier discussion,  we may assume that $P_1\not=0$. 
Let $(T_n)$ be any divisibility sequence satisfying (\ref{4Tn}) and $p$ be any fixed prime 
such that $p \mid T_n$ for some $n>0$.
\begin{definition}\label{defomega1}
Let $\omega_1$  be the least positive integer such that $p\mid T_{\omega_1}$.  We define the increasing sequence $\omega_1$,
$\omega_2, \dots, \omega_j\in \mathbb{Z}$ by $p\mid T_{\omega_i}$ and $\omega_i\nmid \omega_j$ $(1\leq i<j)$.
Each $\omega_i$ in this sequence is called a \emph{rank of appearance}\footnote{Lucas used the term ``le rang d'apparition''
and the French word ``apparition'' has been--and still is--widely used among English writers.  However, it is best to avoid the ghostly or miraculous connotation 
that the English word ``apparition'' possesses and use ``appearance'' instead.} of $p$.
\end{definition}
\begin{definition}
If $p\mid T_n$ implies that $\omega_1\mid n$, then $p$ has a single rank of appearance in $(T_n)$.
Such a sequence is said to be \emph{monoapparitic} modulo $p$ and the prime $p$ is said to be \emph{monoapparitic} in $(T_n)$.  
\end{definition}
\noindent In \cite{War38} Ward proved that primes have only finitely many ranks of appearance in a general LDS.  In this paper we shall be concerned with the special case 
of an odd LDS of order $4$.

With the exception of Section \ref{OddD}, we will reserve the notation $(A_n)$ to denote an odd, non-null and non-degenerate LDS of order $4$.  
By \cite[Proposition 4.1]{WG15} we may assume that $\gcd(P_1,P_2,Q)=1$.
The purpose of this paper is to prove Theorem A below.\\

{\bf  Theorem A.}
{\it Let $(A_n)$ satisfy (\ref{4Tn}) and let $p$ be any prime such that $p\mid A_n$ for some $n>1$;
 $p$ can have at most two ranks of appearance in $(A_n)$.
If $p\nmid P_1$, then $p$ has only one rank of appearance (is monoapparitic) in $(A_n)$ when $p\mid Q\Delta E$.
It is also monoapparitic if $S=1$, $G\not=1$; $S\not=1$, $G=1$; or $S=G\not=1$.
In the case of $S=G=1$, there are sequences $(A_n)$ for which $p$ ($p\nmid P_1$) can have two distinct ranks of appearance.
}\\

We will prove Theorem A by showing that it holds for each of the cases $(i)$--$(iv)$.  
In Section \ref{OddD} we derive a number of useful identity relations connecting $(A_n)$ to some special sequences $(X_n)$, $(Y_n)$, $(U_n)$ and  $(W_n)$.
We also prove a version of Theorem \ref{nondeg1} in the particular case of $(A_n)$.  
In the following section we provide a number of simple results which allow for the determination of when a prime $p$ is monoapparitic in $(A_n)$ for certain special cases.
We also show that in general a prime can have at most two ranks of appearance in $(A_n)$.
The remaining sections deal with the problem of when $p$ can be monoapparitic in the cases that remain.






\section{Odd divisibility sequences of order $4$}\label{OddD}

We have already seen that odd LDSs of order $4$ exist; for example, $(\bar{u}_n(r,q))$ is such a sequence.
Furthermore, the sequences \seqnum{A215466} and \seqnum{A127595} in the 
{\it On-line Encyclopedia of Integer Sequences} (OEIS) (see Sloane \cite{Slo20}) are examples of odd LDSs of order $4$ which are not 
Lehmer sequences.
In what follows we will derive some results which must be true for $(A_n)$ if $(A_n)$ is simply an odd linear recurrence sequence of order $4$.  
In the first part of this section we will develop some of the machinery needed throughout the paper.  
We then use these results to prove the main result of the section: Theorem \ref{AnTheo}. This theorem is a more specialized version 
of Theorem \ref{nondeg1} and helps in discerning when $(A_n)$ can and cannot be a divisibility sequence.

We begin, as was done in \cite{WG11} and \cite{WG15}, by defining the auxiliary sequences $(W_n)$, $(U_n)$, $(X_n)$ and $(Y_n)$ by 
\begin{equation}\label{WnUn}
v_n(\rho_i,Q)=W_n+\rho_i U_n=\alpha_i^n+\beta_i^n
\end{equation}
and
\begin{equation}\label{XnYn}
u_n(\rho_i,Q)=X_n+\rho_i Y_n =\displaystyle\frac{\alpha_i^n-\beta_i^n}{\alpha_i-\beta_i};
\end{equation}
here $\rho_i=\alpha_i+\beta_i$ $(i=1,2)$.
Also, $\rho_1$, $\rho_2$ are the distinct roots of $x^2-P_1x+P_2=0$.
We point out here that $X_n=U_{0,n}$, $Y_n=U_{1,n}$, $W_n=V_{0,n}$, $U_n=V_{1,n}$, where the symbols $U_{i,n}$, $V_{i,n}$ $(i=0,1)$
are defined in \cite[(10.1.5) and (10.1.6)]{Wil98} (with $k=2$).
Notice each of  $(W_n)$, $(U_n)$, $(X_n)$, $(Y_n)$ satisfies (\ref{4Tn}).  Also, the initial terms of these sequences are as follows:
\begin{align*}
W_{-1}&=0,                       &W_{0}&=2,      &W_{1}&=0,      &W_{2}&=-P_2-2Q,        &W_{3}&=-P_1P_2;\\
U_{-1}&=\frac{1}{Q},        &U_{0}&=0,      &U_{1}&=1,      &U_{2}&=P_1,      &U_{3}&=P_1^2-P_2-3Q;\\
X_{-1}&=\frac{-1}{Q},                          &X_{0}&=0,      &X_{1}&=1,        &X_{2}&=0,           &X_{3}&=-P_2-Q;\\
Y_{-1}&=0,          &Y_{0}&=0,      &Y_{1}&=0,        &Y_{2}&=1,        &Y_{3}&=P_1.
\end{align*}
Further,
\begin{equation*}
(X_n), (Y_n), (W_n), (U_n) \subseteq \mathbb{Z} \quad (n\geq 0).
\end{equation*}
By Theorem \ref{odd}, we see that both $(X_n)$ and $(Y_n)$ are odd.  Indeed, we have
\begin{equation*}
X_{-n}=-X_n/Q^n, \quad Y_{-n}=-Y_n/Q^n.
\end{equation*}
Also,
\begin{equation*}
W_{-n}=W_n/Q^n,\quad U_{-n}=U_n/Q^n,
\end{equation*}
thus  $(W_n)$, $(U_n)$ are even.

In \cite{WG15} it is noted that if $(A_n)$ is a LDS of order $4$, then 
\begin{equation}\label{A2thing}
A_n=X_n+A_2Y_n;
\end{equation}
however, this condition is not sufficient for $(A_n)$ to be such a sequence.
From Theorem \ref{nondeg1} we can derive the following result.
\begin{proposition}
For $(A_n)$ defined as above we must have 
\[
A_n\mid Q^{n-1}JY_n^2U_n^2,
\] 
where $J=A_2^2-P_1A_2+P_2$.
\end{proposition}
\begin{proof}
By Theorem \ref{nondeg1}, we know that $A_n$ must be a divisor of $r_n$ for all $n\geq 0$, where here
\begin{equation}\label{rnlong}
r_n=\frac{\alpha_1^n-\alpha_2^n}{\alpha_1-\alpha_2}\cdot\frac{\alpha_1^n-\beta_1^n}{\alpha_1-\beta_1}\cdot\frac{\alpha_1^n-\beta_2^n}{\alpha_1-\beta_2}\cdot
\frac{\alpha_2^n-\beta_1^n}{\alpha_2-\beta_1}\cdot\frac{\alpha_2^n-\beta_2^n}{\alpha_2-\beta_2}\cdot\frac{\beta_1^n-\beta_2^n}{\beta_1-\beta_2}.
\end{equation}
Since 
\begin{equation*}
(\rho_1-\rho_2)U_n=\alpha_1^n+\beta_1^n-\alpha_2^n-\beta_2^n,
\end{equation*}
we find from (\ref{Qab}), that
\begin{equation*}
(\rho_1-\rho_2)U_n=\frac{(\alpha_1^n-\alpha_2^n)(\alpha_2^n-\beta_1^n)}{\alpha_2^n}=\frac{(\beta_1^n-\beta_2^n)(\beta_2^n-\alpha_1^n)}{\beta_2^n}.
\end{equation*}
Hence,
\begin{equation*}
Q^n(\rho_1-\rho_2)^2U_n^2=(\alpha_1^n-\alpha_2^n)(\beta_1^n-\beta_2^n)(\alpha_2^n-\beta_1^n)(\beta_2^n-\alpha_1^n);
\end{equation*}
also, for $n=1$,
\begin{equation*}
Q(\rho_1-\rho_2)^2=(\alpha_1-\alpha_2)(\beta_1-\beta_2)(\alpha_2-\beta_1)(\beta_2-\alpha_1).
\end{equation*}
Thus,
\begin{equation*}
Q^{n-1}U_n^2=\frac{\alpha_1^n-\alpha_2^n}{\alpha_1-\alpha_2}\cdot\frac{\beta_1^n-\beta_2^n}{\beta_1-\beta_2}\cdot\frac{\alpha_2^n-\beta_1^n}{\alpha_2-\beta_1}
\cdot\frac{\beta_2^n-\alpha_1^n}{\beta_2-\alpha_1}.
\end{equation*}
By  (\ref{XnYn}), we have
\begin{equation*}
\frac{\alpha_1^n-\beta_1^n}{\alpha_1-\beta_1}\cdot \frac{\alpha_2^n-\beta_2^n}{\alpha_2-\beta_2}=(X_n+\rho_1Y_n)(X_n+\rho_2Y_n)=X_n^2-P_1X_nY_n+P_2Y_n^2.
\end{equation*}
From these results and (\ref{A2thing}) we find that,
\begin{align*}
r_n&=Q^{n-1}((A_n-A_2Y_n)^2-P_1(A_n-A_2Y_n)Y_n+P_2Y_n^2)U_n^2\\
     &=Q^{n-1}(A_n^2-(2A_2+P_1)A_nY_n+JY_n^2)U_n^2,
\end{align*}
where $J=A_2^2-P_1A_2+P_2$ and $r_n$ satisfies $(\ref{rnlong})$.
Thus, we find that 
\begin{equation*}
A_n \mid Q^{n-1} J Y_n^2U_n^2  \quad \mbox{(for all $n\geq 0$)}.
\end{equation*}
\end{proof}
\noindent Later in this section we will improve this result showing that $(A_n)$ is a divisibility sequence if and only if
\begin{equation*}
A_n\mid JY_nU_n \quad \mbox{(for all $n\geq 0$)}.
\end{equation*}

We will next establish some identities involving the sequences $(A_n)$, $(X_n)$, $(Y_n)$, $(W_n)$, $(U_n)$.
We begin with the well-known identity
\begin{equation}\label{alphabetaQ}
(\alpha_i^n+\beta_i^n)^2-(\alpha_i-\beta_i)^2\left( \frac{\alpha_i^n-\beta_i^n}{\alpha_i-\beta_i}\right)^2=
4\alpha_i^n\beta_i^n=4Q^n,
\end{equation}
and get
\begin{equation}\label{4Qn}
(W_n+\rho_iU_n)^2-(\rho_i^2-4Q)(X_n+\rho_iY_n)^2=4Q^n.
\end{equation}
Setting $n=1$ in (\ref{alphabetaQ}) yields $(\alpha_i-\beta_i)^2=(\alpha_i+\beta_i)^2-4\alpha_i\beta_i=\rho_i^2-4Q$.
Since $\rho_i^2=P_1\rho_i-P_2$, we get
\begin{gather*}
\rho_i^2-4Q=P_1\rho_i-P_2-4Q,\\
\rho_i(\rho_i^2-4Q)=\rho_i(P_1\rho_i-P_2-4Q)=(P_1^2-P_2-4Q)\rho_i-P_1P_2,\\
\rho_i^2(\rho_i^2-4Q)=\rho_i^2(P_1\rho_i-P_2-4Q)=P_1(P_1^2-P_2-4Q)\rho_i-P_2(P_1^2-P_2-4Q).
\end{gather*}
It follows from (\ref{4Qn}), that 
\begin{gather*}
W_n^2-P_2U_n^2+(P_2+4Q)X_n^2+2P_1P_2X_nY_n+P_2(P_1^2-P_2-4Q)Y_n^2=4Q^n,\\
2W_nU_n+P_1U_n^2-P_1X_n^2-2(P_1^2-P_2-4Q)X_nY_n-P_1(P_1^2-2P_2-4Q)Y_n^2=0.
\end{gather*}
From (\ref{A2thing}), we find by replacing $A_n-A_2Y_n$ for $X_n$ that 
\begin{equation}\label{LI}
2W_nU_n+P_1U_n^2-P_1A_n^2+2A_nLY_n-IY_n^2=0
\end{equation}
and
\begin{equation}\label{K}
W_n^2-P_2U_n^2+(P_2+4Q)A_n^2-2A_nY_n(A_2(P_2+4Q)-P_1P_2)+KY_n^2=4Q^n.
\end{equation}
Here
\begin{gather}
I=P_1A_2^2-2(P_1^2-P_2-4Q)A_2+P_1(P_1^2-2P_2-4Q),\label{Iref}\\
K=(P_2+4Q)A_2^2-2P_1P_2A_2+P_2(P_1^2-P_2-4Q)\label{Kref}
\end{gather}
and
\begin{equation}
L=P_1A_2-P_1^2+P_2+4Q.\label{Lref}
\end{equation}

From
\begin{align*}
2(X_{n+m}+\rho_iY_{n+m})&=2\left( \frac{\alpha_i^{n+m}-\beta_i^{n+m}}{\alpha_i-\beta_i}\right)\\
&=
\left( \frac{\alpha_i^{n}-\beta_i^{n}}{\alpha_i-\beta_i}\right)(\alpha_i^m+\beta_i^m)+\left( \frac{\alpha_i^{m}-\beta_i^{m}}{\alpha_i-\beta_i}\right)(\alpha_i^n+\beta_i^n)\\
&=(X_n+\rho_iY_n)(W_m+\rho_iU_m)+(X_m+\rho_iY_m)(W_n+\rho_iU_n),
\end{align*}
so we find that 
\begin{align*}
2X_{n+m}&=W_nX_m+W_mX_n-P_2(U_nY_m+U_mY_n),\\
2Y_{n+m}&=U_nX_m+U_mX_n+W_nY_m+W_mY_n+P_1(U_nY_m+U_mY_n).
\end{align*}
Multiplying the second of these by $A_2$ and adding, we see since $A_n=X_n+A_2Y_n$ that
\begin{equation}\label{2Anm}
2A_{n+m}=W_nA_m+W_mA_n+A_2(U_nA_m+U_mA_n)-J(U_nY_m+U_mY_n).
\end{equation}
By using
\begin{align*}
2(W_{n+m}+\rho_iU_{n+m})&=2(\alpha_i^{n+m}+\beta_i^{n+m})\\
&=(\alpha_i^n+\beta_i^n)(\alpha_i^m+\beta_i^m)+(\alpha_i-\beta_i)^2\left(\frac{\alpha_i^n-\beta_i^n}{\alpha_i-\beta_i}\right)
\left(\frac{\alpha_i^m-\beta_i^m}{\alpha_i-\beta_i}\right)\\
&=(W_n+\rho_iU_n)(W_m+\rho_iU_m)+(\rho_i^2-4Q)(X_n+\rho_iY_n)(X_m+\rho_iY_m),
\end{align*}
we get
\begin{multline*}
2W_{n+m}=W_nW_m-P_2U_nU_m-(P_2+4Q)X_nX_m-P_1P_1(X_nY_m+X_mY_n)\\
-P_2(P_1^2-P_2-4Q)Y_nY_m
\end{multline*}
and
\begin{multline*}
2U_{n+m}=U_nW_m+U_mW_n+P_1(U_nU_m+X_nX_m)+(P_1^2-P_2-4Q)(X_nY_m+X_mY_n)\\
+P_1(P_1^2-2P_2-4Q)Y_nY_m.
\end{multline*}
Once again, using (\ref{A2thing}), we derive
\begin{equation}\label{2Unm}
2U_{n+m}=U_nW_m+U_mW_n+P_1(U_nU_m+A_nA_m)-L(A_nY_m+Y_nA_m)+IY_nY_m,
\end{equation}
where $L=A_2P_1-(P_1^2-P_2-4Q)$.
Note the following easily established connection between $I$, $J$, $K$ and $L$:
\begin{equation}\label{IJKL}
JL+K=A_2I.
\end{equation}
If we put $m=n$ in (\ref{2Anm}) we get
\begin{equation}\label{A2n}
A_{2n}=A_n(W_n+A_2U_n)-JU_nY_n.
\end{equation}
Also, from \cite{WG11} we have 
\begin{align}
U_{2n}&=2U_nW_n+P_1U_n^2\label{2U2n}\\
           &=P_1A_n^2-2LA_nY_n+IY_n^2.\label{2U2n2}
\end{align}
Since
\begin{equation*}
\frac{\alpha_i^{n+m}-\beta_i^{n+m}}{\alpha_i-\beta_i}=(\alpha_i^m+\beta_i^m)\left(\frac{\alpha_i^{n}-\beta_i^{n}}{\alpha_i-\beta_i}\right)
-Q^m\left(\frac{\alpha_i^{n-m}-\beta_i^{n-m}}{\alpha_i-\beta_i}\right),
\end{equation*}
we have
\begin{equation*}
X_{n+m}+\rho_i Y_{n+m}=(W_{m}+\rho_i U_{m})(X_{n}+\rho_i Y_{n})-Q^m(X_{n-m}+\rho_i Y_{n-m})
\end{equation*}
and we find
\begin{align*}
X_{n+m}&=W_mX_n-P_2U_mY_n-Q^mX_{n-m},\\
Y_{n+m}&=U_mX_n+W_mY_n+P_1U_mY_n-Q^mY_{n-m}.
\end{align*}
It follows from the above and (\ref{A2thing})
\begin{align}
A_{n+m}&=A_n(W_m+A_2U_m)-JU_mY_n-Q^mA_{n-m},\label{FirstAnm}\\
Y_{n+m}&=U_mA_n+Y_n(W_m+(P_1-A_2)U_m)-Q^mY_{n-m}.
\end{align}
Since $(A_n)$ is odd, we have $Q^mA_{n-m}=-Q^nA_{m-n}$ and 
\begin{equation}\label{NewAnm}
A_{n+m}=A_n(W_m+A_2U_m)-JU_mY_n+Q^nA_{m-n}.
\end{equation}
Putting $m=kn$ and $n=n$ in (\ref{NewAnm}), we get
\begin{equation}\label{Ank}
A_{(k+1)n}=A_n(W_{kn}+A_2U_{kn})-JU_{kn}Y_n+Q^nA_{(k-1)n}.
\end{equation}

We are now able to prove the main result of this section.
\begin{theorem}\label{AnTheo}
If $(A_n)$ is an odd recurrence sequence of order $4$, then $(A_n)$ is a divisibility sequence if and only if $A_n\mid JU_nY_n$ for all $n \geq 1$.
\end{theorem}
\begin{proof}
If $(A_n)$ is a divisibility sequence, then $A_n\mid A_{2n}$ which implies $A_n\mid JU_nY_n$ by (\ref{A2n}).
Next, suppose that $A_n\mid JU_nY_n$.  Since it is well known (see \cite{WG11}) that $(U_n)$ is a divisibility sequence, we know that $U_n\mid U_{kn}$
for any $k\geq 0$.  Thus, by (\ref{Ank}) we have
\begin{equation*}
A_{(k+1)n}\equiv Q^n A_{(k-1)n} \pmod{A_n} \quad (k \geq 1).
\end{equation*}
Hence, if $A_n\mid A_{(k-1)n}$, then $A_n\mid A_{(k+1)n}$.  Since $A_n\mid A_n$ and, by (\ref{A2n}), 
$A_n\mid A_{2n}$, we find by induction that $A_n\mid A_{mn}$ for any $m\geq 0$.
\end{proof}
\begin{corollary}
If $(A_n)$ is an odd LDS of order $4$, then $A_2\mid P_1P_2$.
\end{corollary}
\begin{proof}
Follows easily from the theorem and the simple fact that $J\equiv P_2\pmod{A_2}$.
\end{proof}






\section{Monoapparitic primes in odd divisibility sequences of order $4$ }\label{MonoSection}

We now let $(A_n)$ denote an odd, non-null, and non-degerate LDS of order 4.
The purpose of much of this section is to identify certain monoapparitic primes in $(A_n)$.
If all primes are monoapparitic in $(A_n)$, we say that $(A_n)$ is monoapparitic.
We observe by attempting all possible values for $P_1$, $P_2$, $Q$, $A_2$ modulo $2$ that only in the case of $2\mid P_1$, $2\nmid P_2 Q$, $2\mid A_2$
is it possible for $2$ to not be monoapparitic in $(A_n)$.  In this case we see that $2\mid I$, where $I$ is given by (\ref{Iref}), $\omega_1=2$ and $\omega_2=3$.

We begin with the simple result below.
\begin{proposition}\label{mmidJ}
If $m$ is a positive integer and $m\mid J$,  where $J=A_2^2-P_1A_2+P_2$,
then $A_n\equiv \modd{u_n(A_2,Q)} {m}$.
\end{proposition}
\begin{proof}
We have $A_0=0=u_0(A_2,Q)$, $A_1=1=u_1(A_2,Q)$, $A_2=u_2(A_2,Q)$, $A_3=X_3+A_2Y_3=P_1A_2-P_2-Q\equiv A_2^2-Q=u_3(A_2,Q)$ (mod $m$). 
Also, since
\begin{equation*}
Qu_k(A_2,Q)=A_2u_{k+1}(A_2,Q)-u_{k+2}(A_2,Q),
\end{equation*}
we get
\begin{equation*}
Qu_{k+1}=A_2u_{k+2}-u_{k+3}, \quad
Q^2u_k=QA_2u_{k+1}-Qu_{k+2}
             =(A_2^2-Q)u_{k+2}-A_2u_{k+3}.
\end{equation*}
Here we use $u_k$ to denote $u_k(A_2,Q)$.
It follows that 
\begin{equation}\label{ukstuff}
P_1Qu_{k+1}-Q^2u_k=(P_1A_2-A_2^2+Q)u_{k+2}-(P_1-A_2)u_{k+3}.
\end{equation}
Now suppose for some $k\geq 0$, we have $A_{k+i}\equiv \modd{u_{k+i}(A_2,Q)} {m}$  $(i=0,1,2,3)$; this is certainly true for $k=0$.  
By (\ref{4Tn}), we get
\begin{align*}
A_{k+4}&\equiv P_1u_{k+3}-(P_2+2Q)u_{k+2}+P_1Qu_{k+1}-Q^2u_k\\
             &= P_1u_{k+3}-(P_2+2Q)u_{k+2}+(P_1A_2-A_2^2+Q)u_{k+2}-(P_1-A_2)u_{k+3}\\
             &= A_2u_{k+3}-(P_2+2Q-P_1A_2+A_2^2-Q)u_{k+2}\\
             &\equiv A_2u_{k+3}-Qu_{k+2}= u_{k+4}\pmod{m},
\end{align*}
by (\ref{ukstuff}) and $J=A_2^2-P_1A_2+P_2\equiv \modd{0} {m}$.  The result now follows by induction.
\end{proof}
\begin{corollary}\label{pmidJ}
If $p\mid J$, then $p$ is monoapparitic in $(A_n)$.
\end{corollary}
\begin{proof}
If $p\mid J$, then by Proposition \ref{mmidJ} we have
 $A_n\equiv \modd{u_n(A_2,Q)} {p}$.  We must have $p$ a monoapparitic prime in $(A_n)$
because $(u_n(A_2,Q))$ has at most one rank of appearance modulo $p$.
\end{proof}

We next turn to the problem of $p\mid Q$.  We see that from (\ref{4Tn}) that each of $(X_n)$, $(Y_n)$ and $(U_n)$ satisfies
\begin{equation*}
T_{n+2}\equiv P_1 T_{n+1}- P_2T_{n} \pmod{p} \quad (n\geq 2).
\end{equation*}
By the initial conditions for $(X_n)$, $(Y_n)$ and $(U_n)$ and mathematical induction, it is easy to show that
\begin{align*}
&Y_n\equiv u_{n-1}(P_1,P_2)\pmod{p} \quad (n\geq 1),\\
&X_n\equiv -P_2 u_{n-2}(P_1,P_2)\pmod{p} \quad (n\geq 2),\\
&U_n\equiv  u_{n}(P_1,P_2)\pmod{p} \quad (n\geq 0).
\end{align*}
It follows that
\begin{equation*}
A_n=X_n+A_2Y_n\equiv  A_2u_{n-1}-P_2u_{n-2}\pmod{p} \quad (n\geq 2),
\end{equation*}
where we now use $u_n$ to denote $u_n(P_1,P_2)$.
Observe that since $u_{n-1}^2-u_{n-2}u_n=P_2^2$, we must have $p\mid P_2$ if 
$p\mid \gcd(u_n,u_{n-1})$ or $p\mid \gcd(u_{n-1},u_{n-2})$.
However, when $p\mid P_2$, it is easy to show that $u_n\equiv \modd{P_1^{n-1}} {p}$; hence $p\mid P_1$, which since $\gcd(P_1,P_2,Q)=1$, is impossible.
Thus, $\gcd(u_n,u_{n-1})=1$ and $\gcd(P_2,u_n)=1$ for all $n\geq1$, when $p\mid Q$.  We can now prove the following proposition. 
 \begin{proposition}\label{pdividesQ}
If $p$ be a prime such that $p\mid Q$, then $p$ must be monoapparitic  in $(A_n)$.
\end{proposition}
\begin{proof}
By Theorem \ref{AnTheo}, we must have $A_n\mid JY_nU_n$ for all $n\geq 1$.
If $p\mid A_n$, then $p\mid J$ means that $p$ is monoapparitic in $(A_n)$.
If $p\nmid JY_n$, then $p\mid U_n$ which means that $p\mid u_n(P_1,P_2)$ and
\begin{equation*}
P_1u_{n-1}-P_2u_{n-2}\equiv 0\pmod{p}.
\end{equation*} 
Also, $p\mid A_n$ implies that
\begin{equation*}
A_2u_{n-1}-P_2u_{n-2}\equiv 0\pmod{p}.
\end{equation*} 
Hence, $p\mid (A_2-P_1)u_{n-1}$.  Since, $p\nmid u_{n-1}$, we get $p\mid A_2-P_1$, but in this case we get 
$A_n\equiv u_n(P_1,P_2) \pmod{p}$, which means that $p$ is monoapparitic in $(A_n)$.
If $p\mid Y_n$, then $p\mid u_{n-1}$, which since $p\mid A_n$ means that $p\mid P_2u_{n-2}$.
If $p\nmid P_2$, then $p\mid u_{n-2}$, which is impossible. 
If $p\mid P_2$, then $p\mid \gcd(P_2,u_{n-1})$ and $\gcd(u_{n-1},u_{n})\not=1$, which is also impossible. 
\end{proof}

We next define two sequences $(G_n)$ and $(H_n)$:
\begin{equation*}
G_n=\gcd(A_n,Y_n) \quad \mbox{and} \quad H_n=\gcd(A_n,U_n).
\end{equation*}
Note that since $A_n=X_n+A_2Y_n$, we have $G_n=\gcd(X_n,Y_n)$. 
By \cite[Lemma 10.3.8]{Wil98}, we know that $(G_n)$ is a divisibility sequence, but not necessarily a LDS.
\begin{proposition}
For $G_n$ and $H_n$ defined as above, we have $\gcd(G_n,Q)=1$.  Also, $\gcd(H_n,Q)=1$ 
when $\gcd(A_2-P_1,Q)=1$
\end{proposition}
\begin{proof}
The first result follows from \cite[Lemma 10.3.9]{Wil98}.
Next, suppose that $p$ is any prime such that $p\mid Q$ and $p\mid H_n$.
Referring to the proof of Proposition \ref{pdividesQ}, we find that we must have $p\mid A_2-P_1$, which means that 
$\gcd(A_2-P_1,Q)\not=1$.
\end{proof}

If $p$ is any prime, let $\rho=\rho(p)$ denote the least positive integer  value of $n$ (if it exists) such that $p\mid G_n$.
\begin{theorem}\label{Grho}
If $p$ is any prime such that $p\mid G_n$, then $\rho\mid n$.
\end{theorem}
\begin{proof}
This proof can be found in \cite[Theorem 10.3.13]{Wil98}. 
\end{proof}


We will next obtain a somewhat similar result for $(H_n)$.
By making use of the identity
\begin{equation*}
\alpha_i^{n+m}+\beta_i^{n+m}=(\alpha_i^{n}+\beta_i^{n})(\alpha_i^{m}+\beta_i^{m})-Q^m(\alpha_i^{n-m}+\beta_i^{n-m}),
\end{equation*}
we can easily derive
\begin{align}
&W_{m+n}=W_mW_n-P_2U_mU_n-Q^mW_{n-m},\nonumber \\
&U_{m+n}=W_mU_n+W_nU_m+P_1U_nU_m-Q^mU_{n-m}.\label{Umn}
\end{align}
From (\ref{A2n}) and  (\ref{2U2n}), we see that
\begin{equation*}
H_n\mid H_{2n}.
\end{equation*}
By (\ref{Umn}) and (\ref{Ank}), we have
\begin{align*}
&U_{(k+1)n}=W_{kn}U_n+W_nU_{kn}+P_1U_{kn}U_n-Q^nU_{(k-1)n},\\
&A_{(k+1)n}=A_{n}(W_{kn}+A_2U_{kn})-JU_{kn}Y_{n}+Q^nA_{(k-1)n}.
\end{align*}
Since $H_n\mid H_n$ and $H_n\mid H_{2n}$, it is easy to establish by induction on $m$ that $H_n\mid H_{mn}$; thus, $(H_n)$ is a divisibility sequence.

For any fixed prime $p$, let $\sigma=\sigma(p)$, if it exists, be the least positive value of $n$ such that $p\mid H_n$.
If $p\mid Q$ and $p\mid H_n$, then as we have seen earlier $p\mid u_n(P_1,P_2)$ and $A_n\equiv U_n\equiv \modd{u_n(P_1,P_2)}  {p}$ $(p\mid Q)$.
Thus, if $p\mid H_n$, then $\sigma\mid n$.
We next show that if $p$ is any odd prime such that $p\nmid Q$, then $\sigma\mid n$ whenever $p\mid H_n$.

\begin{theorem}\label{sigmaH}
Let $p$ be any odd prime such that $p\nmid Q$.  If $p\mid H_n$, then $\sigma(p)\mid n$.
\end{theorem}
\begin{proof}
We first note that by (\ref{LI}) we have $H_n\mid IY_n^2$ for any $n$.
Suppose $p\mid H_n$ and $n=q\sigma+r$ with $0<r<\sigma$.
From (\ref{2Unm}) and (\ref{2Anm}) we have 
\begin{equation*}
2U_n=U_{q\sigma}W_{r}+W_{q\sigma}U_{r}+P_1(U_{q\sigma}U_{r}+A_{q\sigma}A_{r})-L(A_{q\sigma}Y_{r}+Y_{q\sigma}A_{r})+IY_{q\sigma}Y_{r}
\end{equation*}
and
\begin{equation*}
2A_n=W_{q\sigma}A_{r}+A_{q\sigma}W_r+A_2(U_{q\sigma}A_{r}+A_{q\sigma}U_{r})-J(U_{q\sigma}Y_{r}+Y_{q\sigma}U_{r}).
\end{equation*}
Since $(H_n)$ is a divisibility sequence and $p\mid H_\sigma$ $(\sigma=\sigma(p))$ we must have $p \mid H_{q\sigma}$ and $p\mid IY_{q\sigma}$.  
Thus,
\begin{align*}
& 0\equiv W_{q\sigma}U_r-LY_{q\sigma}A_r \pmod{p},\\
&0\equiv W_{q\sigma}A_r-JY_{q\sigma}U_r \pmod{p}.
\end{align*}
If $p\nmid I$, then $p\mid Y_{q\sigma}$,  $p\mid W_{q\sigma}U_r$ and $p\mid W_{q\sigma}A_r$;
consequently if $p\nmid W_{q\sigma}$, we get $p\mid H_r$.
If $p\mid W_{q\sigma}$, then by (\ref{K}) we get $p\mid 4Q^{q\sigma}$, which is impossible by selection of $p$.
If $p\mid I$, then by (\ref{IJKL}) and (\ref{K}), we get
\begin{equation*}
W_{q\sigma}^2-LJY_{q\sigma}^2\equiv W_{q\sigma}^2+KY_{q\sigma}^2\equiv  4Q^{q\sigma}\pmod{p}.
\end{equation*}
Since $p\nmid 4Q^{q\sigma}$, we must also have $p\mid H_r$.  
In either case we find that we get a contradiction to the definition of $\sigma$ when $r>0$.  Hence, $\sigma(p)\mid n$.
\end{proof}

We next address the question of the existence of $\rho(p)$ and $\sigma(p)$.
We will only concern ourselves with those primes $p$ such that $p$ divides some term $A_n$ $(n>0)$ of $(A_n)$ and $p\nmid J$.
By Theorem \ref{AnTheo}, we must have $p\mid G_n$ or $p\mid H_n$; thus, at least one of $\rho(p)$ or $\sigma(p)$ must exist.
From (\ref{A2n}) and (\ref{2U2n2}), we can easily deduce that
\begin{equation}\label{GnH2n}
G_n\mid H_{2n};
\end{equation}
hence, if $\rho(p)$ exists, then $p\mid H_{2\rho}$ and therefore $\sigma(p)$ must exist.
Also, even if $\rho(p)$ does not exist, then $\sigma(p)$ must exist
and $p$ is monoapparitic in $(A_n)$.
Since $\gcd(G_n,Q)=1$, we see that if $p\mid Q$, then $\rho(p)$ cannot exist.
Also, if $p\mid Q$ and $A_2\not\equiv \modd{P_1} {p}$, then $p\nmid H_n$ and as a result $\sigma(p)$ cannot exist.

We will now examine several additional special cases.  Throughout this discussion $p$ will denote a prime such that $p\nmid 2Q$.
\begin{enumerate}[label= \bf{Case \arabic*}, leftmargin=.61in]
  \item \hspace{-.2cm}\bf{:}  $p\mid P_1$.  \label{FirstCase}
 \end{enumerate}
  In this case, it is easy to prove by using (\ref{4Tn}) and mathematical induction that for $n\geq 0$ we have
  \begin{equation}\label{XY2n2n+1}
  X_{2n}\equiv 0, \quad X_{2n+1}\equiv \bar{u}_n(-P_2,Q), \quad Y_{2n}\equiv \bar{u}_{2n}(-P_2,Q), \quad Y_{2n+1}\equiv 0\pmod{p}.
  \end{equation}
  Hence, $G_n=\gcd(X_n,Y_n)\equiv \bar{u}_n(-P_2,Q)$ (mod $p$).  By results in \cite{Leh30} (See \S \ref{I=0} below for details.)
  we know that if $p\nmid P_2$, then $p\mid \bar{u}_n(-P_2,Q)$ if and only if $\tau \mid n$, where $\tau$ is the rank of appearance of $p$ in
  $(\bar{u}_n(-P_2,Q))$.
  Since $p\nmid Q$, $\tau$ must exist and $\tau \mid p-\kappa$, where $\kappa$ is the value of the Legendre symbol $((P_2^2+4QP_2)/p)$.
  Hence, $\rho(p)$ exists and $\rho(p)=\tau$ when $p\nmid P_2$.
  Suppose $p\mid P_2$; then $p\nmid \bar{u}_n(-P_2,Q)$ for any odd $n>0$ and $\rho(p)$ does not exist.
  If $2\mid n$, then $p\mid (\bar{u}_n(-P_2,Q))$ if and only if $p\mid n$; hence, $\rho(p)=\tau=p$ in this case.
   \begin{proposition}\label{pmidP1}
  If $p\mid P_1$, then $p$ is monoapparitic in $(A_n)$ when $p\nmid A_2$.
  If $p\mid P_1$, $p\mid A_2$ and $2\mid \tau$, then $p$ is also monoapparitic in $(A_n)$.
  If $p\mid P_1$, $p\mid A_2$ and $2\nmid \tau$, it is possible for $p$ to have two ranks of appearance in $(A_n)$, 
  namely $2$ and $\tau$.
  Also, if $p\mid P_1$, $p\mid A_2$ and $p\mid P_2$, then $p$ is monoapparitic in $(A_n)$.
  \end{proposition}
  \begin{proof}
  If $p\mid P_1$, $p\mid A_2$ and $p\mid P_2$, then $p\mid J$ and therefore $p$ is monoapparitic  in $(A_n)$ by Corollary \ref{pmidJ}.
  Furthermore,
  by (\ref{XY2n2n+1}) we have 
  \begin{equation*}
A_n=
\begin{dcases}
     \bar{u}_n(-P_2,Q), & \mbox{if $2\nmid n$}; \\
     A_2 \bar{u}_n(-P_2,Q),  & \mbox{if $2\mid n$}.\\
    \end{dcases}\\
\end{equation*}
The result now easily follows from our observations in \ref{FirstCase}.
  \end{proof}

 \begin{enumerate}[label= \bf{Case \arabic*}, leftmargin=.61in]
 \setcounter{enumi}{1}
  \item \hspace{-.2cm}\bf{:}  $p\nmid P_1$, $p\mid \Delta$. \label{SecondCase}
  \end{enumerate}
  In \cite[\S 6]{WG11} it is shown that
  \begin{equation*}
  U_n\equiv nu_n(P_1/2,Q) \pmod{p}.
  \end{equation*}
  Also, it is easy, on using the initial conditions for $(X_n)$ and $(Y_n)$, to see that
  \begin{equation}\label{initial}
  X_n+(P_1/2) Y_n\equiv u_n(P_1/2,Q) \pmod{p}
  \end{equation}
  for $n=0$, $1$, $2$, $3$.
  On putting $P_2\equiv P_1^2/4$  (mod $p$), we use (\ref{4Tn}) and mathematical induction to verify that (\ref{initial}) is true 
  for all $n\geq 1$.
  Thus, if $p\mid G_n$, then $p\mid H_n$. Hence, if $\rho(p)$ exists, then $\sigma(p)$ exists and $\sigma(p)\mid \rho(p)$ by
  Theorem \ref{sigmaH}.
   \begin{enumerate}[label= \bf{Case \arabic*}, leftmargin=.61in]
   \setcounter{enumi}{2}
  \item \hspace{-.2cm}\bf{:}  $p\nmid P_1\Delta$, $p\mid E$. \label{ThirdCase}
  \end{enumerate}
  We first observe by \cite[(2.5)]{WG15} we have 
  \begin{equation}\label{Ething}
  \Delta P_1^2+4E =(P_1^2-2P_2-8Q)^2;
  \end{equation}
  thus, since $p\mid E$ and $p\nmid P_1\Delta$, we must have $(\Delta/p)=1$.
  Let $\mathbb{K}$ be the splitting field of $F(x)$ in $\mathbb{F}_p[x]$ and let $\alpha_1$, $\beta_1$, $\alpha_2$, $\beta_2$  
  $(\alpha_1\beta_1=\alpha_2\beta_2=Q)$ be the roots of $F(x)=0$ in $\mathbb{K}$.
  Since $E=(\alpha_1-\beta_1)^2(\alpha_2-\beta_2)^2$, we have $\alpha_1=\beta_1$ or $\alpha_2=\beta_2$ in $\mathbb{K}$.
  We assume with no loss of generality that $\alpha_1=\beta_1$.
  If, as well, $\alpha_2=\beta_2$, then since $(\alpha_i-\beta_i)^2=\rho_i^2-4Q$ $(i=1$, $2)$, we see that $\rho_1^2=\rho_2^2$, 
  which since $p\nmid P_1\Delta$ is impossible.
  Thus $\alpha_1=\beta_1$ and $\alpha_2\not=\beta_2$.
  Also, since $(\Delta/p)=1$, we must have $\rho_1-\rho_2 \in \mathbb{F}_p \subseteq \mathbb{K}$ and therefore $\rho_1$, $\rho_2\in \mathbb{F}_p$.
  Since $\alpha_1=\beta_1$, we have $\rho_1=2\alpha_1$.  Thus in $\mathbb{F}_p$
  \begin{equation*}
  u_n(\rho_1,Q)=\frac{\alpha_1^n-\beta_1^n}{\alpha_1-\beta_1}=n \alpha_1^{n-1}
  \quad \mbox{ and } \quad
  u_n(\rho_2,Q)=\frac{\alpha_2^n-\beta_2^n}{\alpha_2-\beta_2}.
  \end{equation*}
  By definition of $(X_n)$ and $(Y_n)$, we find that in $\mathbb{F}_p$
  \begin{equation*}
  X_n+\rho_1Y_n=n \alpha_1^{n-1} \quad \mbox{ and } \quad X_n+\rho_2Y_n=u_n(\rho_2,Q).
  \end{equation*}
  Thus, if $p\mid G_n$, then $n \alpha_1^{n-1}=0$ and $u_n(\rho_2,Q)=0$ in $\mathbb{F}_p$.
  Since $p\nmid Q$, we see that $p\mid n$.  
  Also, by \cite[Lemma 8.1]{WG11} we know that if $\tau$ is the rank of appearance of $p$ in $u_n(\rho_2,Q)$, 
  then $\tau \mid n$, where $\tau\mid p-\lambda$ and $\lambda$ is the value of the Legendre symbol $((P_1^2-2P_2-8Q)/p)$.
  Since $\alpha_2\not=\beta_2$, we cannot have $\lambda=0$; thus, $\gcd(\tau,p)=1$ and $p\tau\mid n$.
  Furthermore, if $p\tau\mid n$, then $X_n+\rho_1Y_n=X_n +\rho_2 Y_n$ in $\mathbb{F}_p$.
  Since $\rho_1-\rho_2\not=0$, $Y_n=X_n=0$ and $p\mid G_n$.
  It follows that in this case, $\rho(p)$ exists and $\rho(p)=p\tau$.


Finally, we deal with the case of $p\nmid \Delta E Q$.
If $(\Delta/p)=1$, there must exist some $d$ such that $d^2\equiv \Delta \pmod{p}$.
In this case, put $e=P_1^2-\Delta-16Q+2P_1d$ and $\eta$ is the value of the Legendre symbol $(e/p)$.
We define the function $\Phi(p)$ by
\begin{equation*}
\Phi(p)=
\begin{dcases}
     p-\eta, & \mbox{if $(\Delta/p)=1$, $(E/p)=1$}; \\
     p^2-1, & \mbox{if $(\Delta/p)=1$, $(E/p)=-1$}; \\
        p^2-(E/p), & \mbox{if $(\Delta/p)=-1$}. \\
    \end{dcases}\\
\end{equation*}
We now have the following result.
\begin{theorem}
If $p$ is any odd prime such that $p\nmid \Delta E Q$, then both $\rho=\rho(p)$ and $\sigma=\sigma(p)$ must exist and are divisors of $\Phi(p)$.
\end{theorem}
\begin{proof}
By \cite[Theorem 10.3.10]{Wil98} and results in \cite[\S 7]{WG11}, we know that $p\mid G_{\Phi(p)}$ and $p\mid U_{\Phi(p)}$;
hence $p\mid H_{\Phi(p)}$.
It follows that both $\rho$ and $\sigma$ exist for $p$ and by Theorems \ref{Grho} and \ref{sigmaH}, we must have
$\rho(p)\mid \Phi(p)$ and $\sigma(p)\mid \Phi(p)$, respectively.
\end{proof}

While it is the case that the Lucas sequences have a single rank of appearance, we have seen that higher order divisibility sequences may 
have multiple ranks of appearance \cite{War38}.
In the theorem below we now show that $(A_n)$ can have at most two ranks of appearance for any prime $p$.

\begin{theorem}\label{most2ranks}
Any prime $p$ can have at most two ranks of appearance in $(A_n)$.
\end{theorem}
\begin{proof}
By our previous results we may assume that $p\nmid 2QJ$.  If $p\mid A_n$, then by Theorem \ref{AnTheo}, we must have $p\mid Y_n$ or $p\mid U_n$.
That is, $\rho(p)\mid n$ or $\sigma(p) \mid n$.
It follows that there can be at most two ranks of appearance of $p$ in $(A_n)$, namely $\rho$ and $\sigma$.
\end{proof}

We will next derive some simple conditions under which a prime $p$ must be monoapparitic in $(A_n)$.
We have already seen that this will be the case if $p\mid Q$ or $p\mid J$; thus we will assume in what follows that $p\nmid 2QJ$.
Let $\omega=\omega_1(p)$, where $\omega_1$ is defined in Definition \ref{defomega1} with $(T_n)=(A_n)$.  
Put $\rho=\rho(p)$, $\sigma=\sigma(p)$, when they exist.  Since $p\mid A_\rho$ and $p\mid A_\sigma$, 
it is clear that $\omega\leq \rho$ and $\omega\leq \sigma$.



\begin{proposition}\label{omegarhosigma}
For the symbols $p$, $\omega$, $\sigma$ and $\rho$ defined above, we have $\omega=\rho$ or $\omega=\sigma$.
\end{proposition}
\begin{proof}
By Theorems \ref{most2ranks}, \ref{Grho} and \ref{sigmaH}, we must have $\rho\mid \omega$ or $\sigma \mid \omega$.
Since $\rho, \sigma \geq \omega$, we can only have $\omega=\rho$ or $\omega=\sigma$.
\end{proof}

\begin{proposition}\label{AnMono}
Under the conditions of Proposition \ref{omegarhosigma}, $p$ is monoapparitic in $(A_n)$ when $\sigma \mid \rho$ or $\rho \mid \sigma$.
\end{proposition}
\begin{proof}
We show that if $p\mid A_n$, then $\omega\mid n$.  Suppose $\sigma \mid \rho$.  
In this case $\sigma\leq \rho$; hence, by Proposition \ref{omegarhosigma} and the definition of $\omega$ we must have $\omega=\sigma$.
If $p\mid A_n$, then we must have $\sigma \mid n$ or $\rho \mid n$ by Theorem \ref{most2ranks}, which means that $\sigma\mid n$ and $\omega\mid n$.
Similarly, if $\rho \mid \sigma$, then $\omega=\rho$ and $\rho\mid n$.
\end{proof}

\begin{proposition}\label{pnmidP1}
If $p\nmid P_1$, and $p\mid \Delta$, then $p$ is monoapparitic in $(A_n)$.
\end{proposition}
\begin{proof}
In \ref{SecondCase} we showed that if $p$ satisfies the conditions of the proposition, then either $\rho(p)$ and $\sigma(p)$ both exist
and $\sigma \mid \rho$, or $\rho(p)$ does not exist. In either case $p$ must be monoapparitic in $(A_n)$.
\end{proof}

By (\ref{GnH2n}) we see that if
 $p\mid G_\rho$, we must have $p \mid H_{2\rho}$ and therefore
\begin{equation*}
\sigma\mid 2\rho
\end{equation*} 
by Theorem \ref{sigmaH}.
It follows that if $2\nmid \sigma$, then $\sigma \mid \rho$ and $p$ is monoapparitic in $(A_n)$.

\begin{proposition}\label{rho<sigma}
If $\rho \leq \sigma$, then $p$ is monoapparitic in $(A_n)$.
\end{proposition}
\begin{proof}
We may assume that $2\mid \sigma$.  Since $\sigma/2\mid \rho$, we get $\rho=t\sigma/2\leq \sigma$.  
Thus, $t=1$, $2$.
If $t=2$, then $\rho=\sigma$ and we are done.
If $t=2$, then $\rho=\sigma/2$.  Since $\rho\mid \sigma$, the result follows from Proposition \ref{AnMono}.
\end{proof}
Thus, if $\rho \leq \sigma$ or $2\nmid \sigma$, we see that $p$ is monoapparitic in $(A_n)$.
In the following result we present another condition for this to be the case.

\begin{theorem}\label{Isingle}
If $p\nmid I$, then $(A_n)$ has a single rank of appearance modulo $p$.
\end{theorem}
\begin{proof}
We may assume that $p\nmid 2QJ$.
  It suffices to show that if $p\mid A_n$, then $\omega\mid n$.
If $p\mid A_n$, then $p\mid U_n$ or $p\mid Y_n$ which means that $p\mid H_n$ or $p\mid G_n$.
If $p\mid H_n$, by (\ref{LI}) we see that $p\mid G_n$.  
Thus, $p\mid G_\omega$ and we must have $\rho \mid \omega$.  Since $\omega\leq \rho$, we have $\omega=\rho$.
Also, since $p\mid G_n$, we have $\rho\mid n$, which means that $\omega\mid n$.
\end{proof}

We have seen, then, that if $p\nmid I$, $p$ is a monoapparitic prime in $(A_n)$.   
If $I\not=0$, this means that only a finite number of primes can have two ranks of appearance in $(A_n)$.
In the next section we will deal with the case of $I=0$ and the case of $p\mid I$.

 \section{Some results when $I=0$ or $p\mid I$}\label{I=0}

Put
\begin{equation}\label{gh}
g=P_1^2-P_2-4Q, \quad h=P_1(P_1^2-2P_2-4Q)
\end{equation}
and note that 
\begin{equation}\label{ghE}
E=g^2-P_1h.
\end{equation}
If $I=0$, we have from (\ref{Iref}) that
\begin{equation}\label{ifI=0}
P_1A_2^2-2gA_2+h=0.
\end{equation}
As mentioned in Section \ref{Intro}, we  assume that $P_1\not=0$.  By (\ref{ghE}) the discriminant of
\begin{equation*}
P_1x^2-2gx+h=0
\end{equation*}
is $4E$.
Thus, for $A_2 \in \mathbb{Z}$, we see that $E$ must be a perfect integral square, which means that $G=1$.


In the case of $p\mid I$, we can convert (\ref{ifI=0}) into a congruence modulo $p$ and find that
\begin{equation}\label{Emodp}
(P_1A_2-g)^2\equiv E\pmod{p}.
\end{equation}
We are now able to complete our discussion of the special cases that arise when $p\mid D$ in (\ref{D}).
\begin{proposition}\label{pmidEprop}
If $p\nmid 2P_1$ and $p\mid E$, then $p$ is monoapparitic in $(A_n)$.
\end{proposition}
\begin{proof}
Put
\[
q\equiv (P_2+4Q)/P_1 \pmod{p}.
\]
Since $p\mid E$, we have
\[
q^2\equiv 4Q \pmod{p}.
\]
by the second formula in (\ref{theDelta}).
From (\ref{Emodp}), we see that
\[
A_2\equiv P_1-q \pmod{p};
\]
thus,
\[
J=A_2^2-P_1A_2+P_2\equiv q^2-P_1q+P_2\equiv 4Q-(P_2+4Q)+P_2\equiv 0\pmod{p}.
\]
By Corollary \ref{pmidJ}, $p$ must be monoapparitic in $(A_n)$.
\end{proof}
\noindent By combining the results of Propositions \ref{pdividesQ}, \ref{pnmidP1} and \ref{pmidEprop}, we have the following result.
\begin{theorem}\label{threetogether}
If $p$ is any prime such that $p\nmid 2P_1$ and $p\mid \Delta E Q$, then $p$ is monoapparitic in $(A_n)$.
\end{theorem}

We next deal with $(A_n)$ when $p$ is an odd prime and Case \ref{remaining1} of Section \ref{Intro} holds, i.e., $G=S\not=1$.
We put 
 \begin{equation}\label{dc}
 d=P_1^2-2P_2-8Q, \quad c=P_1(P_1^2-3P_2-4Q).
 \end{equation}
By \cite[Theorem 5.2]{WG15} we know that if $(A_n)$  is an odd LDS, then 
 \begin{equation}\label{dA2}
 dA_2=c\pm \sqrt{\Delta E};
 \end{equation}
 thus,
 \begin{equation}\label{dA2squared}
 d^2A_2^2-2cdA_2+c^2-\Delta E=0.
 \end{equation}

In what follows we will assume that $p\nmid P_1$.  Since $p\mid I$,  by (\ref{ifI=0}) we have
\begin{equation}\label{pmidI}
P_1A_2^2-2gA_2+h\equiv 0\pmod{p}.
\end{equation}
It is easy to verify by referring to (\ref{theDelta}), (\ref{gh}) and (\ref{dc}) that 
\begin{equation}\label{gd}
gd-P_1c=2E
\end{equation}
and
\begin{equation}\label{csquared}
\Delta P_1 h+ P_1^2 E=c^2.
\end{equation}


From (\ref{dA2squared}) and (\ref{pmidI}), we have 
\begin{equation*}
P_1d^2A_2^2-2cdP_1A_2+P_1(c^2-\Delta E)\equiv 0\pmod{p}
\end{equation*}
and
\begin{equation*}
P_1d^2A_2^2-2gd^2A_2+d^2h\equiv 0\pmod{p}.
\end{equation*}
On subtracting the second of these congruences from the first we get
\begin{equation}\label{2d}
2d(gd-P_1c)A_2+P_1(c^2-\Delta E)-d^2h \equiv 0\pmod{p}.
\end{equation}
Now by (\ref{csquared}) we have
\begin{equation*}
P_1(c^2-\Delta E)-d^2h=E(P_1^3-P_1\Delta-4h)=-4E(h-P_1P_2)=4Ec;
\end{equation*}
it follows from this, (\ref{2d}) and (\ref{gd}) that
\begin{equation}\label{4dEA2}
4dEA_2-4Ec\equiv 0\pmod{p}.
\end{equation}

We are now able to derive the following simple result.
\begin{theorem}\label{monohere}
If $p$ is a prime such that $p\nmid 2P_1$, then $p$ is monoapparitic in $(A_n)$ when $S=G\not=1$.
\end{theorem}
\begin{proof}
By Theorem \ref{threetogether}, we see that the theorem holds when $p\mid \Delta E$.
Suppose $p\nmid \Delta E$ and $p\mid I$.  
If $p=2$ and $p\nmid P_1$, then we have already seen that $p$ is monoapparitic in $(A_n)$.
Thus, we may assume here that $p\not=2$.
By (\ref{4dEA2}), we get
\begin{equation*}
dA_2-c\equiv 0\pmod{p}
\end{equation*}
and by (\ref{dA2}) we must have $p\mid\Delta E$, a contradiction.  
Thus $p$ must be monoapparitic in $(A_n)$.
\end{proof}


In \cite{WG12}, it is shown that if $G=1$,
there must exist integers $r_1$, $r_2$, $q_1$, $q_2$ such that $r_1$, $r_2>0$;
$\gcd(r_1,q_1)=\gcd(r_2,q_2)=1$;
\begin{equation}\label{P1P2Qriqi}
P_1^2=r_1r_2, \quad P_2=q_1r_2+q_2r_1-4q_1q_2, \quad Q=q_1q_2.
\end{equation}
We find that $\Delta=P_1^2-4P_2=d_1d_2$, where $d_i=r_i-4q_i$ $(i=1,2)$, $E=(q_1r_2-q_2r_1)^2$ and 
$g=r_1r_2-r_1q_2-r_2q_1$.
It is also shown in \cite{WG12} that for the values of $P_1$, $P_2$, $Q$ given by (\ref{P1P2Qriqi}), we have 
\begin{equation*}
\alpha_1=\mu_1\mu_2,\quad \beta_1=\nu_1\nu_2,\quad \alpha_2=\nu_1\mu_2, \quad \beta_2=\mu_1\nu_2,
\end{equation*}
where $\mu_i+\nu_i=\sqrt{r_i}$, $\mu_i\nu_i=q_i$ $(i=1,2)$. Since $\mu_1/\nu_1=\alpha_1/\alpha_2$ and 
$\mu_2/\nu_2=\alpha_2/\beta_1$, we see that since $(A_n)$ is non-degenerate, we cannot have $\mu_1/\nu_1$ or $\mu_2/\nu_2$ 
a root of unity; in particular $\mu_1\not=\nu_1$ and $\mu_2\not=\nu_2$.

We next observe that
\begin{align}
 (\alpha_1^n-\beta_1^n)+(\alpha_2^n-\beta_2^n)&=\mu_1^n\mu_2^n-\nu_1^n\nu_2^n+\mu_1^n\nu_2^n-\mu_2^n\nu_1^n
 =(\mu_1^n-\nu_1^n)(\mu_2^n+\nu_2^n)\label{abmn1}\\
(\alpha_1^n-\beta_1^n)-(\alpha_2^n-\beta_2^n)&=(\mu_1^n+\nu_1^n)(\mu_2^n-\nu_2^n).\label{abmn2}
\end{align}
Put 
\begin{equation*}
M_n=u_n(\sqrt{r_1},q_1)v_n(\sqrt{r_2},q_2), \quad N_n=v_n(\sqrt{r_1},q_1)u_n(\sqrt{r_2},q_2). 
\end{equation*}
We have
\begin{equation*}
(\mu_1^n-\nu_1^n)(\mu_2^n+\nu_2^n)=(\mu_1-\nu_1)M_n, \quad (\mu_1^n+\nu_1^n)(\mu_2^n-\nu_2^n)=(\mu_2-\nu_2)N_n.
\end{equation*}
Also, by (\ref{abmn1}) and (\ref{abmn2}) and the definition of $(X_n)$, $(Y_n)$, we get 
\begin{align*}
&(\alpha_1-\beta_1)X_n+(\alpha_1-\beta_1)\rho_1Y_n+(\alpha_2-\beta_2)X_n+(\alpha_2-\beta_2)\rho_2Y_n=(\mu_1-\nu_1)M_n,\\
&(\alpha_1-\beta_1)X_n+(\alpha_1-\beta_1)\rho_1Y_n-(\alpha_2-\beta_2)X_n-(\alpha_2-\beta_2)\rho_2Y_n=(\mu_2-\nu_2)N_n.
\end{align*}
Since $\rho_i=\alpha_i+\beta_i$ $(i=1,2)$, we see, by (\ref{abmn1}) and (\ref{abmn2}) with $n=2$, that
\begin{equation*}
(\alpha_1-\beta_1)\rho_1+(\alpha_2-\beta_2)\rho_2=(\mu_1^2-\nu_1^2)(\mu_2^2+\nu_2^2)
\end{equation*}
and
\begin{equation*}
(\alpha_1-\beta_1)\rho_1-(\alpha_2-\beta_2)\rho_2=(\mu_1^2+\nu_1^2)(\mu_2^2-\nu_2^2).
\end{equation*}
It follows that
\begin{align}
&\sqrt{r_2}X_n+\sqrt{r_1}(r_2-2q_2)Y_n=M_n, \label{Mnwithrq}\\
&\sqrt{r_1}X_n+\sqrt{r_2}(r_1-2q_1)Y_n=N_n. \label{Nnwithrq}
\end{align}
From \cite{WG12}, we also have
\begin{equation*}
U_n=u_n(\sqrt{r_1}, q_1)u_n(\sqrt{r_2}, q_2).
\end{equation*}
If we put
\begin{equation*}
R_n=\bar{u}_n(r_1,q_1)\bar{v}_n(r_2,q_2), \quad S_n=\bar{u}_n(r_2,q_2)\bar{v}_n(r_1,q_1),
\end{equation*}
we get
\begin{align*}
&M_n=\sqrt{r_2}R_n, \quad N_n=\sqrt{r_1}S_n \quad \mbox{ if $2\nmid n$},\\
&M_n=\sqrt{r_1}R_n, \quad N_n=\sqrt{r_2}S_n \quad \mbox{ if $2\mid n$},
\end{align*}
and
\begin{equation}\label{UnCases}
U_n=
\begin{dcases}
     \bar{u}_n(r_1,q_1)\bar{u}_n(r_2,q_2), & \mbox{if $2\nmid n$}; \\
   P_1 \bar{u}_n(r_1,q_1)\bar{u}_n(r_2,q_2),  & \mbox{if $2\mid n$}.\\
    \end{dcases}\\
\end{equation}

If $I=0$, then with a possible interchange of the parameters $r_1$, $r_2$ and  $q_1$, $q_2$, we get
\begin{align*}
A_2&=\frac{g\pm\sqrt{E}}{P_1}=\sqrt{r_1r_2}-2q_1\sqrt{\frac{r_2}{r_1}}=v_2(\sqrt{r_1},q_1)\frac{u_2(\sqrt{r_2},q_2)}{\sqrt{r_1}}.
\end{align*}
Notice that
\begin{align*}
&A_{-1}=\frac{-1}{Q}=v_{-1}(\sqrt{r_1},q_1)\frac{u_{-1}(\sqrt{r_2},q_2)}{\sqrt{r_1}},\\
&A_{0}=0=v_{0}(\sqrt{r_1},q_1)\frac{u_{0}(\sqrt{r_2},q_2)}{\sqrt{r_1}},\\
&A_{1}=1=v_{1}(\sqrt{r_1},q_1)\frac{u_{1}(\sqrt{r_2},q_2)}{\sqrt{r_1}};
\end{align*}
thus, if we put 
\begin{equation*}
B_n=v_{n}(\sqrt{r_1},q_1)\frac{u_{n}(\sqrt{r_2},q_2)}{\sqrt{r_1}}=N_n/\sqrt{r_1},
\end{equation*}
we have $A_i=B_i$ $(i=-1,0,1,2)$.  Since $\alpha_1$, $\beta_1$, $\alpha_2$, $\beta_2$  
 are the distinct roots of (\ref{char}), we see that the sequence $(B_n)$ given by
\begin{equation*}
B_n=\left(\frac{\mu_1^n+\nu_1^n}{\mu_1+\nu_1} \right)\left(\frac{\mu_2^n-\nu_2^n}{\mu_1-\nu_1} \right)
=\frac{\alpha_1^n-\beta_1^n+\alpha_2^n-\beta_2^n}{\alpha_1-\beta_1+\alpha_2-\beta_2}
\end{equation*}
must satisfy (\ref{4Tn}).  Since the initial values of $(B_n)$ and $(A_n)$ are equal, it follows that
\begin{equation}\label{AnBnCases}
A_n=B_n=v_{n}(\sqrt{r_1},q_1)\frac{u_{n}(\sqrt{r_2},q_2)}{\sqrt{r_1}}=
\begin{dcases}
     \bar{v}_n(r_1,q_1)\bar{u}_n(r_2,q_2), & \mbox{if $2\nmid n$}; \\
 \frac{r_2}{P_1}   \bar{v}_n(r_1,q_1)\bar{u}_n(r_2,q_2),  & \mbox{if $2\mid n$},\\
    \end{dcases}\\
\end{equation}
when $I=0$.
Also, if $p\nmid P_1QE$, $G=1$ and $p\mid I$, we can use (\ref{Emodp}) and the  above reasoning to show that 
\begin{equation}\label{newAnmodp}
A_n\equiv
\begin{dcases}
     \bar{v}_n(r_1,q_1)\bar{u}_n(r_2,q_2)\pmod{p}, & \mbox{if $2\nmid n$}; \\
 \frac{r_2}{P_1}   \bar{v}_n(r_1,q_1)\bar{u}_n(r_2,q_2) \pmod{p}, & \mbox{if $2\mid n$}.\\
    \end{dcases}\\
\end{equation}

Thus, by Theorem \ref{monohere} we have disposed of Case \ref{remaining1} in Section \ref{Intro}.  
Since in Case \ref{remaining2}, $(A_n)$ is the Lucas sequence $(u_n)$, we see that $p$ must also be monoapparitc in $(A_n)$.
This leaves only the two cases when $G=1$.  We deal with the first of these in the next section.

\section{The case of $G=1$ and $S\not=1$}

Before proceeding any further, we will need to review some simple properties of the Lehmer sequences $(\bar{u}_n(r,q))$ and $(\bar{v}_n(r,q))$.
We have the simple identities
\begin{equation}\label{u2n}
\bar{u}_{2n}=\bar{v}_n \bar{u}_n
\end{equation}
and
\begin{equation}\label{vn2}
\begin{dcases}
 r \bar{v}_n^2-d\bar{u}_n^2=4q^n, & \mbox{if $2\nmid n$}; \\
  \bar{v}_n^2-rd\bar{u}_n^2=4q^n, & \mbox{if $2\mid n$}.\\
    \end{dcases}\\
\end{equation}
where $d=r-4q$ and we use $\bar{u}_n$ and $\bar{v}_n$ to represent $\bar{u}_n(r,q)$ and $\bar{v}_n(r,q)$, respectively.  
If $2\nmid n$, it is easy to prove
\begin{equation}
\bar{u}_n(mr,mq)=m^{\frac{n-1}{2}}\bar{u}_n(r,q)\label{baru1}
\end{equation}
and
\begin{equation}
\bar{u}_n(r-4q,q)=\bar{v}_n(r,q).\label{baru2}
\end{equation}
Also, from results in \cite{Leh30} the 
 sequence $(\bar{u}_n(r,q))$ is a fourth-order linear divisibility sequence
as is $(a_n\bar{u}_n(r,q))$, where $(a_n)$ is a special periodic sequence of integers such that $a_1=1$ and $a_n\mid a_{2n}$.
Indeed, the sequence  $(a_n)$ must be some $(\bar{v}_n(r,q))$, where $q=\pm 1$ and $r=q$, $2q$ or $3q$.


Let $\tau=\tau(p)$ be the rank of appearance (apparition) of a prime $p$ $(p\nmid 2rq)$ in $(\bar{u}_n(r,q))$.
Note that $p\mid \bar{u}_n \Leftrightarrow \tau \mid n$ (\cite[Theorem 1.8]{Leh30}).
We use $\psi=\psi(p)$ to denote the least positive value of $n$, if it exists, such that $p\mid \bar{v}_n$.  We have two simple results.
\begin{theorem}\label{vpsi}
If $p\nmid 2rq$, then $\psi$ exists if and only if $2\mid \tau$;
furthermore, if $2\mid \tau$, then $\psi=\tau/2$.
\end{theorem}
\begin{proof}
Suppose $2\mid \tau$; by definition of $\tau$ we see that $p\nmid \bar{u}_{\tau/2}$ and by (\ref{u2n}) $p\mid \bar{v}_{\tau/2}$.
Thus, $\psi$ exists and $\psi\leq \tau/2$.
Also, by (\ref{u2n}), we have $p\mid \bar{u}_{2\psi}$
and therefore $\tau \mid 2\psi\Rightarrow \tau/2\mid \psi \Rightarrow \psi=\tau/2$.
Next, assume that $\psi$ exists; as above, we have $\tau\mid 2\psi$.  Also, by (\ref{vn2}), we see that $p\nmid \bar{u}_\psi$;
hence $\tau \nmid \psi \Rightarrow 2\mid \tau$.
\end{proof}
\begin{theorem}\label{taueven}
If $p\nmid 2rq$ and $\tau$ is even, then 
$
p\mid v_n\Rightarrow \psi \mid n.
$
and $2\nmid n/\psi$.
\end{theorem}
\begin{proof}
We have $\psi=\tau/2$ exists by Theorem \ref{vpsi}.  Suppose $p\mid \bar{v}_n$.
Since $p\mid \bar{u}_{2n}$, we have $\tau\mid 2n$ and $\tau \nmid n$.
Hence, $\psi \mid n$ and since $2\psi\nmid n$, $n/\psi$ is odd.
\end{proof}

It is  shown in \cite{WG15} that if $G=1$ and $S\not=1$, then $(A_n)$ is given by (\ref{AnBnCases}), where $r_1$, $r_2$, $q_1$ must 
be perfect integral squares. Put $r_i=s_i^2$ $(i=1,2)$.  We find that
\begin{equation}\label{Ansi}
A_n=v_n(s_1,q_1)u_n(s_2,q_2)/s_1
\end{equation}
and if $(A_n)$ is to be a divisibility sequence, we must have
\begin{equation}\label{vn2vn}
v_n(s_1,q_1)\mid 2v_n(s_2,q_2) \quad \mbox{(for all $n\geq 0$)}.
\end{equation}
Let $\tau_i$ be the rank of appearance of the prime $p$ $(p\nmid q_i)$ in $(u_n(s_i,q_i))$ $(i=1,2)$ and put
\begin{equation*}
\omega=
\begin{dcases}
     \tau_1/2, & \mbox{if $2\mid \tau_1$}; \\
   \tau_2,  & \mbox{if $2\nmid \tau_1$}.\\
    \end{dcases}\\
\end{equation*}
Note that for $A_n$ given by (\ref{Ansi}), we have $p\mid A_\omega$.  


We now have the main result of this section.

\begin{theorem}\label{mainomega}
Let $A_n$ be given by  (\ref{Ansi}), subject to (\ref{vn2vn}).
If $p\nmid 2Q$ and $p\mid A_n$, then $\omega \mid n$.
\end{theorem}
\begin{proof}
If $2\nmid \tau_1$, then by Theorem \ref{vpsi} $p\nmid v_{n}(s_1,q_1)$ for any $n$.  
Thus by (\ref{Ansi}) we must have $p\mid u_n(s_2,q_2)$ and $\tau_2\mid n$.
Suppose $2\mid \tau_1$.
If $p\mid v_n(s_1,q_1)$, we must have $\tau_1/2\mid n$ by Theorem \ref{taueven}.
If $p\mid u_n(s_2,q_2)$, then since, $p\mid v_{\tau_1/2}(s_1,q_1)$, we must have
$p\mid v_{\tau_1/2}(s_2,q_2)$ by (\ref{vn2vn}).
Thus, since $\psi_2$ must exist, we have $2\mid \tau_2$ and $\tau_1/2\mid \tau_2/2$.
It follows that since $\tau_2\mid n$, we get $\tau_1/2\mid n$.
\end{proof}

It follows from Proposition \ref{pdividesQ} and Theorem \ref{mainomega} that if $G=1$, $S\not=1$ and $p$ is an odd prime, then $(A_n)$ must be monoapparitic modulo $p$.
We have also shown that if $I=0$ and $S\not=1$, the primes which can divide the terms of $(A_n)$ must all, with the possible exception of $p=2$, be monoapparitic.


\section{The case of $S=G=1$}

We will first investigate the problem of 
 determining those primes $p$ which can be monoapparitic in $(A_n)$ when all we know is just that $G=1$.
We may assume that $p\nmid 2P_1Q$ and $p\mid I$.
If $p\mid U_n$ and $p\mid A_n$, then by (\ref{UnCases}) and (\ref{newAnmodp}) we have
\begin{equation*}
p\mid \bar{u}_n(r_1,q_1)\bar{u}_n(r_2,q_2)\quad \mbox{ and } \quad
p\mid \bar{v}_n(r_1,q_1)\bar{u}_n(r_2,q_2).
\end{equation*}
Let $\tau_i$ $(i=1,2)$ be the rank of appearance (apparition) of $p$ in $\bar{u}_n(r_i,q_i)$.
Since, by (\ref{vn2}), $p\nmid \gcd(\bar{u}_n(r_1,q_1),\bar{v}_n(r_1,q_1))$, we must have $p\mid \bar{u}_n(r_2,q_2)$
and this holds if and only if $\tau_2\mid n$.  Thus, we must have $\sigma=\sigma(p)=\tau_2$.

If $p\mid A_n$ and $p\mid Y_n$, then $p\mid X_n$; also, by (\ref{Mnwithrq}), (\ref{Nnwithrq}) and (\ref{P1P2Qriqi}), we must have, $p\mid R_n$ and $p\mid S_n$.  
Hence,
\begin{equation*}
p\mid \bar{u}_n(r_1,q_1)\bar{v}_n(r_2,q_2)\quad \mbox{ and } \quad p\mid \bar{u}_n(r_2,q_2)\bar{v}_n(r_1,q_1).
\end{equation*}
If $\tau_1\mid n$, then $p\mid \bar{u}_n(r_1,q_1)$ and $p\nmid \bar{v}_n(r_1,q_1)$ by (\ref{vn2}).
Thus, $\tau_2 \mid n$ and $\rho=\rho(p)=\lcm[\tau_1,\tau_2]$.
If $\tau_1\nmid n$, then $p\mid \bar{v}_n(r_2,q_2)$.  We must have $2\mid \tau_2$ and $\tau_2/2\mid n$.
Also, $p\nmid \bar{u}_n(r_2,q_2)$ and $p\mid \bar{v}_n(r_1,q_1)$ and we must also have $2\mid \tau_1$
and $\tau_1/2 \mid n$.
In this case we put $\psi_i=\tau_i/2$ and let $2^{\lambda_i}\mid \mid \psi_i$  $(i=1,2)$.
Since $n/\psi_i$ $(i=1,2)$ must be odd, we must have $\lambda_1=\lambda_2$.
Thus, if $\lambda_1\not=\lambda_2$, we have $\rho=\lcm[\tau_1,\tau_2]$.
If $\lambda_1=\lambda_2$, then $\rho=\lcm[\psi_1,\psi_2]$ and $\sigma\nmid \rho$.

We now have the following result.

\begin{proposition}\label{G=1pmidI}
Suppose $G=1$, $p$ is a prime such that $p\nmid 2P_1Q$ and $p\mid I$. If $2\nmid \tau_1$ or $2\nmid \tau_2$, then
$p$ must be monoapparitic in $(A_n)$.
\end{proposition}
\begin{proof}
In this case $\sigma=\tau_2$ and $\rho=\lcm[\tau_1, \tau_2]$. Thus, $\sigma \mid \rho$ and the result follows by Proposition \ref{AnMono}.
\end{proof}

Before proceeding any further we will need some additional results concerning Lehmer sequences.
It is easy to establish by induction that if $p\mid r$, then for $n$ odd we have
\begin{equation*}
\bar{v}_n(r,q)\equiv n (-q)^{\frac{n-1}{2}}\pmod{p}, \quad \bar{u}_n(r,q)\equiv  (-q)^{\frac{n-1}{2}}\pmod{p}.
\end{equation*}
Thus, if $p\mid r$ and $2\nmid n$, we have $p\mid \bar{v}_n(r,q) \Leftrightarrow p\mid n$.
Also, if $2\mid n$ and $p\mid r$, then $\bar{u}_n(r,q) \equiv \modd{n/2 (-q)^{n/2}} {p}$.
Thus, if $p\mid r$ and $2\mid n$, then $p\mid \bar{u}_n(r,q) \Leftrightarrow p\mid n/2$.
Also, if $2\mid n$ and $p\mid r$, then 
\begin{equation*}
u_n(r,q)\equiv n/2(-q)^{n/2}\pmod{p}.
\end{equation*}
Thus, if $p\mid r$ and $2\mid n$, then $p\mid u_n(r,q) \Leftrightarrow p\mid n/2$.
It follows that $(\bar{u}_n(r,q))$ is monoapparitic modulo $p$ when $p\nmid 2q$.

It is well known (\cite[\S4]{Leh30}) that $p\mid \bar{u}_{p-\epsilon}$, where $\epsilon$ is the value of the Legendre symbol $(rd/p)$.
Thus, if $p\mid d$, then $p\mid \bar{u}_p$ and $\tau(p)=p$.
Since $p$ is odd, $\psi=\psi(p)$ does not exist in this case.
If $p\nmid d$, then 
\begin{equation*}
p\mid \bar{v}_{\frac{p-\epsilon}{2}}\Leftrightarrow \left(q/p\right)=-1.
\end{equation*}
Hence, if $(q/p)=-1$, then $\psi$ exists and $\psi \mid \frac{p-\epsilon}{2}$.


A special case of Proposition \ref{G=1pmidI} occurs when $(q_1/p)=(q_2/p)=1$ and $((d_1d_2)/p)=-1$.
For in this case, $\tau_1 \mid \frac{p-\epsilon_1}{2}$, $\tau_2 \mid \frac{p-\epsilon_2}{2}$.
Also, $\epsilon_1\epsilon_2=((r_1r_2d_1d_2)/p)=((d_1d_2)/p)=-1$.
It follows that if $2\mid \tau_1$ and $2\mid \tau_2$ we get $2\mid  \frac{p-\epsilon_1}{2}$ and $2\mid  \frac{p-\epsilon_2}{2}$,
which means that $p\equiv \modd{1} {4}$ and $p\equiv \modd{-1} {4}$, an impossibility. 

If $G=1$ and $S\not=1$, it is shown in \cite{WG15} than any odd fourth-order LDS $(A_n)$ must have the form given in (\ref{AnBnCases}), i.e.,
\begin{equation}\label{Anunvn}
A_n=v_n(\sqrt{r_1}, q_1)u_n(\sqrt{r_2},q_2)/\sqrt{r_1},
\end{equation}
but it is not always the case that this $(A_n)$ will actually be a divisibility sequence.  For example, if $r_1=r_2=7$ and $q_2=141002$, we see that
$(A_n)$ behaves like a divisibility sequence until we arrive at the $28^{\rm th}$ term, where we discover that $A_{14}$ is not a divisor of $A_{28}$.
Indeed, as mentioned in \cite{WG15}, it is unlikely that and $(A_n)$ exists when $G=1$ and $S\not=1$, but this has not yet been proved.

If in (\ref{AnBnCases}) we put $r=r_1$, $q=q_1$, $\mu_2=\mu_1^s$, $\nu_2=\nu_1^s$, 
then  $r_2=v_s(\sqrt{r},q)^2=r\bar{v}_s(r,q)^2$ and $q_2=q^s$, where $s$ is any fixed odd positive integer.  
For these values of $r_1$, $r_2$, $q_1$, $q_2$, (\ref{Anunvn}) becomes
\begin{equation}\label{Anbars}
A_n=\bar{v}_n(r,q)\bar{u}_{ns}(r,q)/\bar{u}_s(r,q).
\end{equation}
(This $A_n$ is essentially the same function as that discovered by Koshkin \cite{Kos19} when $f(x)=(x+1)(x^3-1)$
and $x=\alpha/\beta$, where $\alpha+\beta=\sqrt{r}$ and $\alpha \beta=q$.)
It can be shown that this $(A_n)$ is a fourth-order odd LDS with characteristic polynomial given by (\ref{char}) with $P_1$, $P_2$, $Q$ defined in (\ref{P1P2Qriqi});
also, by using some identities that are satisfied by the Lehmer functions, we have $P_1=r\bar{v}_s(r,q)$, 
$P_2=q\bar{v}_{s-1}(r,q)\bar{v}_{s+1}(r,q)$, $Q=q^{s+1}$, $\Delta=(r-4q)^2\bar{u}_s(r,q)^2$, $E=(qr(r-4q)\bar{u}_{s-1}(r,q)\bar{u}_{s+1}(r,q))^2$,
 $A_2=(r-2q)\bar{v}_s(r,q)$ and $I=0$.  Notice that  we have $S=1$ here.

In the particular case of $s=3$, we have $P_1=r(r-3q)$, $P_2=q(r-2q)(r^2-4rq+2q^2)$, $Q=q^4$ and 
$A_2=(r-2q)(r-3q)$, whereas for $(U_n)$ we would have $A_2=P_1=r(r-3q)$.
If we put $r=5$ and $q=1$, we get $P_1=10$, $P_2=21$, $Q=1$, 
\begin{multline*}
U_n=0,1,10,76,540,3751,25840,177451,1217160,8344876,57202750,\\
392089501,\ldots, (L_{4n}-L_{2n})/4,
\end{multline*}
and the odd sequence
\begin{equation}
0,1,6,38,252,1705,11628,79547,544824,3733234,25585230,175356611,\ldots.\label{oddSeq}
\end{equation}
These sequences are listed as  \seqnum{A215465} and  \seqnum{A215466}, respectively in the OEIS.
The sequence (\ref{Anbars}) with different values for $r$ and $q$ will also yield the odd LDSs:
 \seqnum{A238536} $(r=1, q=-1)$,  \seqnum{A238537} $(r=4, q=-1)$ and
  \seqnum{A238538} $(r=9, q=2)$.

The sequence (\ref{oddSeq}) is an example of a LDS  where $2$ has the two ranks of appearance $2$ and $3$.
Notice that $\bar{v}_3(1,5)=2$.
Indeed, if $p\mid \bar{v}_s(r,q)$, then for $(A_n)$ given by (\ref{Anbars}) we have 
$p\mid P_1$, $p\mid A_2$, $P_2\equiv \modd{q^s(r-4q)} {p}$ and $Q=q^{s+1}$.
We can now use (\ref{baru1}) and (\ref{baru2}) to show that
\begin{equation*}
\bar{u}_{2n+1}(-P_2,Q)\equiv (-1)^n q^{ns}\bar{v}_{2n+1}(r,q) \pmod{p}.
\end{equation*}
Thus, if $p\mid \bar{v}_s(r,q)$, then $\psi(p)$ exists and by Proposition \ref{pmidP1}
there are two possible ranks of appearance of $p$ in $(A_n)$: $2$ and $\psi$.
Since $\psi \mid s$, we have $2\nmid \psi$ and therefore the two ranks are distinct.


Now suppose $p\nmid \bar{v}_s(r,q)$ in  (\ref{Anbars}).
If $p\mid\bar{u}_s(r,q)$, then by  (\ref{vn2}), we have $p\mid d_2$ and therefore $\tau_2=\tau_2(p)=p$.  Since $2\nmid \tau_2$, $p$ 
must be monoapparitic in $(A_n)$ by Proposition \ref{G=1pmidI}.
Next, suppose that $p\nmid \bar{u}_s(r,q)$ and put $t=\gcd(s,\tau_1)$.
It is easy to show that $\tau_2=\tau_1/t$ in this case.
Thus, if $t=1$ or $2\nmid \tau_1$, we have $\tau_2\mid \tau_1$ and consequently $p$ is monoapparitic in $(A_n)$.
If $t>1$ and $2\mid \tau_1$, then $p$ has two distinct ranks of apparition in $(A_n)$: $\omega_1=\sigma=\tau_1/t$ and $\omega_2=\rho=\tau_1/2$.

If we next select $(A_n)$ in (\ref{Anbars}) with $s=3$ and set $A_2= r(r-2q)$, then it turns out that this $(A_n)$ is also an odd fourth-order LDS with characteristic 
polynomial (\ref{char}) and, as before, $P_1=r(r-3q)$, $P_2=q(r-2q)(r^2-4rq+2q^2)$, $Q=q^4$.  Here, it can be shown that 
\begin{equation}\label{AnExampleWithF}
A_n=\bar{u}_{2n}(r,q)u_n(\sqrt{r},q)^2=
\begin{cases}
\bar{v}_n(r,q) \bar{u}_n^3(r,q),& \text{if $2\nmid n$;}\\
r \bar{v}_n(r,q) \bar{u}_n^3(r,q),& \text{if $\mid n$.}
\end{cases}
\end{equation}
If we put $r=5$, $q=1$, we get the sequence
\begin{equation*}
0,1,15,128,945,6655,46080,317057,2176335,14925184,102320625,\ldots, F_{4n}-2F_{2n},
\end{equation*}
which appears as  \seqnum{A127595} in the OEIS.
This sequence is not monoapparitic modulo $5$ as $5$ has ranks $2$ and $5$ in $(A_n)$.  
More generally, if $p\mid r$, then by Proposition \ref{pmidP1}, $(A_n)$ in (\ref{AnExampleWithF})
has ranks of appearance $\omega_1=2$ and $\omega_2=p$,
but if $p\nmid r$, then $p$ is monoapparitic in $(A_n)$ with $\omega=\tau/2$ when $2\mid \tau$ and $\omega=\tau$, otherwise.

If we put $r_1=t^2$, $q_1=q$, $r_2=(t^2-2q)^2$, $q_2=q^2$ and 
$A_2=t^3$, 
we find that
$\Delta=t^2(t^2-4q)^2$ and 
\begin{equation}
A_n=u_n(t,q)^3.\label{cubecase}
\end{equation}  
The corresponding sequence $(A_n)$ is clearly odd and a fourth-order LDS.
For $t=1$, $q=-1$, we get  \seqnum{A056570} in the OEIS.
Also, any prime $p$ is clearly monoapparitic in $(A_n)$.
We should mention here that versions of (\ref{Anbars}), (\ref{AnExampleWithF}) and (\ref{cubecase})
were discovered, using a different approach, by Oosterhout \cite{Oos11}.

We have seen, then, that there are infinitely many odd fourth-order LDSs when $G=S=1$; are there any others apart from those mentioned here?
Possibly, the answer to this question is yes, but no non-trivial examples are known to the authors, none were found during an extensive computer search
and none appear in the OEIS.


 \section{Conclusion}

Although we have completely solved the problem of when $(A_n)$ can have either one or two ranks of appearance (modulo $p$),
 there are still three problems that remain outstanding:
 \begin{enumerate}[1)]
 \item Show that no $(A_n)$ exists when $S\not=1$, $G=1$;
 \item Show that no $(A_n)$ exists when $S=G\not=1$;
 \item Find all possibilities of $(A_n)$ when $S=G=1$.
 \end{enumerate}

 \section{Acknowledgment}
 The authors are grateful to Christian Ballot, who carefully read an earlier version of this paper and made a number of helpful and insightful suggestions for improving it.
We also wish to thank an anonymous referee, whose careful reading of the original submission of this paper resulted in a substantial improvement in its exposition. 
\begin{thebibliography}{10}

\bibitem{ABCM17}
M.~Abrate, S.~Barbero, U.~Cerutti, and N.~Murru, Linear divisibility sequences
  and {S}alem numbers, {\em Pub. Math. Debrecen} {\bf 91} (2017), 247--259.
  
\bibitem{Bar17}
S.~Barbero, Generalized {V}andermonde determinants and characterization of divisibility sequences, 
 {\it J. Number Theory} {\bf 173} (2017), 371--377.

\bibitem{BPP90}
J.-P. B\'ezivin, A. Peth\"o, and A. J. van der Poorten,  A full
characterization of divisibility sequences, {\it Amer. J. Math.} {\bf
112} (1990), 985--1001.

\bibitem{Leh30}
D.~H. Lehmer, An extended theory of {L}ucas' functions, {\em Ann. Math.}
  {\bf 31} (1930), 419--448.
  
\bibitem{Kos19}
Sergiy Koshkin, Non-classical linear divisibility sequences and cyclotomic polynomials, {\em Fibonacci Q.}
  {\bf 57} (2019), 68--80.

 \bibitem{Oos11}
A.~D.~Oosterhout, Characterization of divisibility sequences,  Master's Thesis,
Utrecht University, (2011).

\bibitem{Slo20}
N.~J.~A. Sloane et al., {T}he {O}n-{L}ine {E}ncyclopedia of {I}nteger
  {S}equences, 2020.
\newblock Available at \url{https://oeis.org}.

\bibitem{War38}
Morgan Ward, The law of apparition of primes in a {L}ucasian sequence, {\em Trans. Amer. Math. Soc.}
  {\bf 44} (1938), 68--86.

\bibitem{Wil98}
H.~C. Williams, {\em {{\'{E}}}douard {L}ucas and {P}rimality {T}esting},
Wiley-Interscience, 1998.

\bibitem{WG11}
H.~C. Williams and R.~K. Guy, Some fourth-order linear divisibility sequences,
  {\em Internat. J. Number Theory} {\bf 7} (2011), 1255--1277.
  
  \bibitem{WG12}
H.~C. Williams and R.~K. Guy, Some monoapparitic fourth order divisibility sequences,
  {\em Integers} {\bf 12A} (2012), A17.

 
 \bibitem{WG15}
H.~C. Williams and R.~K. Guy, Odd and even linear divisibility sequences of order 4,
  {\em Integers} {\bf 15} (2015), A33.

\end{thebibliography}


\bigskip
\hrule
\bigskip

\noindent 2010 {\it Mathematics Subject Classification}:
Primary 11B37; Secondary 11Y11, 11B50.

\noindent \emph{Keywords: } 
linear recurrence, Lucas function.

\bigskip
\hrule
\bigskip

\noindent (Concerned with sequences
\seqnum{A005013},
\seqnum{A056570},
\seqnum{A127595},
\seqnum{A215465},
\seqnum{A215466},
\seqnum{A238536},
\seqnum{A238537}, and
\seqnum{A238538}.)

\bigskip
\hrule
\bigskip

\vspace*{+.1in}
\noindent
Received April 7 2021;
revised versions received  June 5 2021; June 22 2021.
Published in {\it Journal of Integer Sequences}, July 1 2021.

\bigskip
\hrule
\bigskip

\noindent
Return to
\htmladdnormallink{Journal of Integer Sequences home page}{https://cs.uwaterloo.ca/journals/JIS/}.
\vskip .1in


\end{document}

                                                                                
††
