<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">\documentclass[12pt,reqno]{article}

\usepackage[usenames]{color}
\usepackage{amssymb}
\usepackage{amsmath}
\usepackage{amsthm}
\usepackage{amsfonts}
\usepackage{amscd}
\usepackage{graphicx}

\usepackage[colorlinks=true,
linkcolor=webgreen,
filecolor=webbrown,
citecolor=webgreen]{hyperref}

\definecolor{webgreen}{rgb}{0,.5,0}
\definecolor{webbrown}{rgb}{.6,0,0}

\usepackage{color}
\usepackage{fullpage}
\usepackage{float}

\usepackage{psfig}
\usepackage{graphics}
\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}}}

\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  On the $p$-adic Valuations of \\
\vskip .1in
Sums of Powers of Integers}
\vskip 1cm
\large
Gombodorj Bayarmagnai and Sainjargal Delger \\  
Department of Mathematics\\
National University of Mongolia\\
Baga Toirog \\
Ulaanbaatar 14200\\
Mongolia\\
\href{mailto:bayarmagnai@num.edu.mn}{\tt bayarmagnai@num.edu.mn}\\
\href{mailto:sdelger96@gmail.com}{\tt sdelger96@gmail.com} \\
\end{center}

\vskip .2 in

\begin{abstract}
In this paper we obtain a simple formula for the number of matching $p$-ary digits of certain terms of Lucas sequences for any odd prime $p$. Using this formula, we present a simple sufficient condition  for the sequence $( v_p(a_1^n + a_2^n + \cdots + a_k^n) )_{n\geq 0}$ to be unbounded, where $a_1, a_2, \ldots, a_k$ ($k \geq 2$) are given integers and $v_p$ is the $p$-adic valuation.
 \end{abstract}
\section{Introduction}
The $p$-adic valuations of integer sequences have been objects of interest because of their surprising properties such as $k$-regularity (Allouche et al.~\cite{AS}, Bell \cite{B}, and Murru et al.~\cite{MS}) and exponent lifting (Birkhoff et al.~\cite{BV} and Sanna \cite{San}). In the paper we focus on the $p$-adic valuations of sequences given by sums of powers of integers and 
differences of terms of Lucas sequences. 

Given an integer $k \geq 2$ and integers $a_1, a_2, \ldots, a_k$ satisfying $|a_i|\geq 2$ for each $1 \leq i \leq k$, let $(s_n )_{n\geq 1}$ be the sequence defined by
\[
	s_n = a_1^n + a_2^n + \cdots + a_k^n
\]
for each $n \geq 1$. For $k=2$, the sequence of the $p$-adic valuations $( v_p(s_n) )_{n \geq 1}$ is well known (Birkhoff et al.~\cite{BV}) and in particular, the sequence is unbounded if $p$ divides a term of $(s_n )_{n\geq 1}$, where $p$ is an odd prime and $v_p$ is the $p$-adic valuation. But it is not true in general. The first purpose of this paper is to present a sufficient condition for the unboundedness of the sequence $( v_p(s_n) )_{n \geq 1}$, especially for the case $k \geq 3$. 

Now, we formulate our main result:
\begin{theorem}\label{thm:1}
	Let $p$ be an odd prime dividing $s_\ell$ for some index $\ell$ such that $\ell&lt; p$. If
\begin{align}\label{for:1}
	 \sum_{(a_i, p)=1}   q(a_i) a_i^\ell \not\equiv 0 \pmod p
\end{align}
	then $( v_p(s_n) )_{n \geq 1}$ is unbounded, where $q(a) = \frac{a^{p-1} -1}{p}$ is the Fermat quotient of $p$ with base $a$. 
\end{theorem}
Our next purpose is to study the rate of growth in the number of matching $p$-ary digits of certain terms of Lucas sequences. This will be useful in the proof Theorem \ref{thm:1}. More precisely, throughout the paper, a Lucas sequence $( U_n )_{n\geq 0}$ is a sequence given by $U_0 = 0$, $U_1 = 1$, and 
\[
	U_n =a U_{n - 1} - b U_{n - 2}, \   n = 2, 3, \ldots,
\] 
where $a$, $b$ are relatively prime integers. We require that $( U_n )_{n\geq 0}$ is nondegenerate, that is, $b \ne 0$ and the ratio $\alpha/\beta$ of the two roots $\alpha$, $\beta$ of the characteristic polynomial $x^2 - ax + b$ is not a root of unity. It is well known that the Lucas quotient $U_\tau/p$ is an integer for any prime $p$ not dividing $2b$ (Ribenboim \cite{R2}), where $( \frac{ \cdot }{ p })$ is the Legendre symbol and $\tau = p- ( \frac{a^2 - 4b}{ p})$. Then our next result is the following.
\begin{theorem}\label{thm:2} 
	Let $( U_n )_{n\geq 0}$ be a Lucas sequence, and let $D$ denote the discriminant of its characteristic polynomial. 
	 For a prime $p$ not dividing $2b$ we have
\begin{displaymath} 
	v_p(  U_{ \tau p^\ell } - p U_{ \tau p^{\ell - 1}} ) =  
		\begin{cases}
			2\ell + \delta + \sigma+ v_p(\tau), &amp;\text{ if  $b^2 \ne  1;$}
	\\
			3\ell + 3\sigma + v_p(D/3)+1, &amp;\text{ if $b^2 = 1$,}
		\end{cases}
\end{displaymath} 
	 for $\ell &gt; \delta$, where $\delta$ and $\sigma$ are the $p$-adic valuations of $b^{p-1}-1$ and $U_\tau/p$, respectively.
\end{theorem} 
The theorem is analogous to the results of Lengyel \cite{Len1, Len2} for the sequences of Motzkin numbers, central binomial coefficients and Catalan numbers.
Note that $\sigma=0$ if $p$ is a Lucas non-Wieferich prime. Assuming the \textit{ABC} conjecture, Ribenboim \cite{R1} showed that there are infinitely many Lucas non-Wieferich primes. 
\section{The number of matching digits}\label{Sec:2} 
In this section we prove Theorem \ref{thm:2}. Before that we need some preliminary results stating properties of  the subsequence $( U_{\tau p^\ell} )_{\ell \geq 0}$. Finally, we see that the sequence defined by the last nonzero digits of $U_{\tau p^\ell} $ in base $p$ is constant. This property is key in the proof of Theorem \ref{thm:1}.
\begin{lemma}\label{lem:1}
	If $p$ is a prime not dividing $2b$ and $n$ is a positive integer divisible by $\tau$ then
\[
	 v_p( U_{ n p^{\ell+1} } ) = v_p(  U_{ n p^\ell } ) + 1
\]
for each positive integer $\ell$.
\end{lemma} 
\begin{proof}
Let $\rho_U(p)$ be the rank of appearance of $p$ in the sequence  $( U_n )_{n\geq 0}$. It is known that $p \mid U_n$ if and only if $\rho_U(p) \mid n$ (see for example, \cite[(3.3), p.\ 12]{R2}). Thus $\tau$ is divisible by $\rho_U(p)$ and hence the formula follows from \cite[Corollary 1.6]{San}.
\end{proof}
We read the $p$-ary digits of $U_{\tau p^\ell}$ from left to right and consider the number of matching $p$-ary digits of $U_{\tau p^\ell}$ and $pU_{\tau p^{\ell - 1}}$, i.e., $v_p (U_{ \tau p^\ell } - p U_{\tau p^{\ell - 1}})$. All the first $\ell+ v_p(U_\tau)$ digits of the two numbers are zero by Lemma \ref{lem:1}, and moreover, the number of matching digits is determined by the $p$-adic valuation of the difference $u_\ell - u_{\ell-1}$, where $u_\ell$ is the $p$-free part of the term $U_{\tau p^\ell}$, i.e.,
\[ 
	u_\ell =   p^{ - v_p( U_{ \tau p^\ell } )  } U_{ \tau p^\ell}.
\] 
\begin{lemma}\label{lem:2}
	For each odd $k\geq 1$ we have
\[
	U_{ k \tau p^\ell } /U_{\tau p^\ell } =  D \sum_{ i = 1 }^{ (k-1)/2 } b^{(\frac{k-1}{2}- i) \tau  p^\ell } U_{i \tau  p^\ell }^2 + k b^{\frac{k-1}{2} \tau  p^\ell }.
\]
\end{lemma} 
\begin{proof}
It is well-known that for all integers $n \geq 0$, it holds $U_n = (\alpha^n - \beta^n)/(\alpha - \beta)$. Hence we have $U_{ k \tau p^\ell }/ U_{\tau p^\ell } = \sum_{ i = 0 }^{ k-1 }  \alpha^{i \tau  p^\ell }  \beta^{ (k-1-i) \tau  p^\ell }$ for any integer $k\geq 1$. For odd $k$ the latter equals 
\[
	  \sum_{ i = 1 }^{ (k-1)/ 2 } b^{( \frac{k-1}{2} - i) \tau  p^\ell } 
				\bigl( \alpha^{i \tau  p^\ell } -  \beta^{i \tau  p^\ell } \bigl)^2 + k b^{\frac{k-1}{2} \tau  p^\ell },
\]
since $b= \alpha \beta$. Thus the lemma follows from this identity and $D = (\alpha - \beta)^2$.
\end{proof}
\begin{lemma}\label{lem:3}
	For each positive integer $\ell$ there exists an integer $t_\ell$ such that
\[
	\frac{ u_{ \ell +1}  }{ u_\ell } =  D U_{\tau p^\ell }^2 \Bigl( p t_\ell + \frac{ p^2- 1}{24} b^{\frac{ p-3 }{2}\tau p^\ell }\Bigl) + b^{\frac{p-1}{2}\tau p^\ell }.
\]
\end{lemma}   

\begin{proof}
For any positive integer $\ell$, by Lemma \ref{lem:2}, we have 
\[
	\frac{ u_{ \ell +1} }{ u_\ell } =  \frac{DU_{\tau p^\ell }^2 }{p } \Bigl( \sum_{ k = 1 }^{(p - 1)/2 } b^{(\frac{p-1}{2} - k ) \tau  p^\ell } 
				( U_{k \tau  p^\ell }/ U_{\tau p^\ell }  )^2 \Bigl) + b^{\frac{p-1}{2} \tau  p^\ell }.
\]
We claim that $(U_{k \tau  p^\ell }/ U_{\tau p^\ell })^2 \equiv k^2 b^{(k-1) \tau  p^\ell }$ (mod $p^{2(\ell +\sigma+1)}$) for each $1 \leq k \leq (p-1)/2$. The claim follows easily from Lemma \ref{lem:2} if $k$ is odd. For even $k$ we have the identity 
\[
	(U_{k \tau  p^\ell }/ U_{ k \tau  p^\ell  /2})^2  =  D U^2_{ k\tau  p^\ell /2 } + 4 b^{ k  \tau  p^\ell /2},
\] which, by induction on $k$, yields the claim. Thus we can conclude from the claim that 
\[
	\sum_{ k = 1 }^{(p-1)/2 } b^{(\frac{p-1}{2} - k ) \tau  p^\ell } (U_{ k \tau  p^\ell }/ U_{\tau  p^\ell })^2 \equiv  \frac{ p^3 - p}{24} b^{\frac{p-3}{2} \tau  p^\ell } \pmod{p^{2(\ell +\sigma+1)}},
\]
completing the proof.
\end{proof}

 We are now ready to prove Theorem \ref{thm:2}.
\begin{proof}[Proof of Theorem \ref{thm:2}]

\noindent \textbf{The case $b^2=1$:} We claim that $b^{\frac{ p-1 }{2} \tau }  = 1$. If $p$ is not a divisor of $D$ then it is clear since $\tau$ is even. Suppose $p$ is a divisor of $D$. Then $\tau = p$ which is odd. If $b=-1$ then $D = a^2+4$ and hence $p \equiv 1$ (mod 4), implying the claim. 

From Lemma \ref{lem:3} and the claim we obtain
\[
	\frac{ u_{ \ell +1} - u_\ell }{ u_\ell^3 } = D p^{2(\ell  +\sigma+1)} \Bigl(p t_\ell + \frac{ p^2 - 1}{24} b^{\frac{ p-3 }{2} \tau p^\ell } \Bigl) 
\]
for some integer $t_\ell$. Therefore
\begin{align}\label{for:2}
	v_p( u_{\ell + 1} - u_\ell ) = 2(\ell + \sigma+1) + v_p(D/3)
\end{align}
for each positive integer $\ell$. 

\bigskip

\noindent\textbf{The case $b^2\ne 1$:}
We claim that $b^\tau$ is a square residue modulo $p$. If $p$ is not a divisor of $D$ then the claim is clear since $\tau$ is even. Suppose $p$ is a divisor of $D$. Then $\tau = p $ and hence we have
\[
	b \equiv \frac{ \bigl(\alpha^{(\tau +1)/2}+\beta^{(\tau +1)/2} \bigl)^2  }{ \bigl(\alpha^{(\tau -1)/2}+\beta^{(\tau -1)/2} \bigl)^2  }   \pmod p,
\]
since $U_\tau$ is divisible by $p$. Moreover, the right hand side is equal to $( U_{\tau +1} U_{ \frac{\tau -1}{2} }  (U_{\tau -1} U_{ \frac{\tau +1}{2} } )^{-1})^ 2$, showing the claim.

By applying Lemma \ref{lem:1} and Lemma \ref{lem:2} we obtain
\[
	v_p( u_{\ell + 1} - u_\ell ) = v_p (b^{\frac{p-1}{2} \tau p^\ell } - 1)
\]
if $\ell  &gt;  \delta$. Since $v_p (b^{\frac{p-1}{2} \tau } - 1) \ne 0$ by the above claim, we have $v_p( u_{\ell + 1} - u_\ell ) = v_p(\tau) + \delta + \ell$ when $\ell  &gt;  \delta$, completing the proof of Theorem \ref{thm:2}.
\end{proof}

\begin{example} The Fibonacci sequence $(F_n)_{n\geq 0}$ is a Lucas sequence with characteristic polynomial $x^2-x-1$. Since $\tau = p \pm 1$ if $p^2 \equiv \pm 1$ (mod $5$) and $\tau = p$ if $p = 5$, we have 
\begin{displaymath}
v_p( f_{\ell + 1} - f_\ell ) = 
	\begin{cases}
		2\ell+1, &amp;\text{ if  $p = 3;$}
	\\
		2\ell + 3, &amp;\text{ if $p =5;$}
	\\
		2\ell + 2v_p(F_{\tau}), &amp;\text{ if  $p \geq 7$.}
\end{cases}
\end{displaymath} 
Here $f_\ell$ denotes the $p$-free part of the $\tau p^\ell$-th Fibonacci number. 
\end{example}
Let $\hat u_\ell$ denote the last nonzero digit of $U_{\tau p^\ell}$ in base $p$. Theorem \ref{thm:2} implies that the sequence $(\hat u_\ell )_{\ell\geq 0}$ is eventually constant since $\hat u_\ell\equiv u_\ell$ (mod $p$) for each positive integer $\ell$.
\begin{lemma} \label{lem:4}
	The sequence $(\hat u_\ell )_{\ell\geq 0}$ is constant. 
\end{lemma}
\begin{proof}
For our purpose it suffices to show that $v_p( u_{ \ell + 1} - u_\ell ) \geq 1$ for any integer $\ell \geq0$. If $b^2 = 1$ then this follows from \eqref{for:1}. In the proof of Theorem \ref{thm:2}, we have seen  that $v_p (b^{\frac{p-1}{2} \tau} - 1) = \delta + v_p( \tau ) \geq 1$ if $b^2\ne 1$. Thus, by Lemma \ref{lem:1} and Lemma \ref{lem:3}, we obtain
\[
	v_p( u_{\ell + 1} - u_\ell ) \geq \min( v_p ( D U_{\tau p^\ell }^2 / 3) , v_p (b^{\frac{p-1}{2} \tau  p^\ell } - 1) )\geq \min( \sigma+1, \delta + v_p( \tau ) ),
\]
completing the proof.
\end{proof}

\section{On sums of powers of integers}
We begin this section with a key lemma which is a version of the lifting the exponent (LTE) lemma and then use it to prove Theorem \ref{thm:1}. 

Let $a_1, a_2, \ldots, a_k$ be integers satisfying $| a_i |\geq 2$ and $p \nmid a_i$ for $1\leq i \leq k$. For each index $i$ define a sequence $q_n^{( i )}$ by the difference $q_n^{( i )} = a^n_i -1$ for any integer $n\geq 0$. Then the sequence of the quotients $\bigl( q^{( i )}_n/ q^{( i )}_1\bigl)_{n\geq 0} $ is a Lucas sequence with characteristic polynomial $x^2 - (a_i + 1)x + a_i$.
\begin{lemma} \label{lem:5}
	Let $p$ be an odd prime. If there exist integers $c_1, c_2, \ldots, c_k$ and $\ell\geq 0$ such that 
\begin{align}\label{for:3}
 	 c_1 q^{ (1) }_{ (p-1) p^\ell } + c_2 q^{ (2) }_{(p-1) p^\ell } + \cdots + c_k q^{ (k) }_{ (p-1) p^\ell } \equiv 0 \pmod{ p^{\ell +\chi +1}} 
\end{align}
	then \eqref{for:3} holds for all $\ell\geq 0$, where $\chi$ is the minimum among all $v_p(q^{ (i) }_{p-1} )$.
\end{lemma}
\begin{proof} 
Denote by $\chi_i$ ($1\leq i\leq k$) the exponent $v_p( q_{p-1}^{ ( i ) })$ which is clearly not zero. For the sequence $\bigl( q^{( i )}_n/ q^{( i )}_1\bigl)_{n\geq 0}$, we have $\tau_i = p$ if $p\mid a_i-1$ and $\tau_i = p-1$ otherwise.

If $\tau_i = p-1$ then apply Lemma \ref{lem:4} to the sequence $\bigl( q^{( i )}_n/ q^{( i )}_1\bigl)_{n\geq 0}$. Then we obtain
\[ 
	(q^{ ( i ) }_{(p-1) p^n } / q^{ ( i ) }_1  )/ p^{\chi_i + n - v_p( q^{ ( i ) }_1 ) }  \equiv (q^{ ( i ) }_{p-1} / q^{ ( i ) }_1  ) / p^{\chi_i - v_p( q^{ ( i ) }_1 )}   \pmod p
\] 
for any integer $n \geq 0$. This yields that $q^{ ( i ) }_{(p-1) p^n }/ p^{\chi_i + n }   \equiv q^{ ( i ) }_{(p-1) p^\ell } / p^{\chi_i +\ell}$ (mod $p$) for any $n\geq 0$.

If $\tau_i = p$ then $v_p(q^{ ( i ) }_{(p-1) \tau_i} ) = 1 + \chi_i$. By applying Lemma \ref{lem:4} to the Lucas sequence $(q^{ ( i ) }_{(p-1) n} / q^{ ( i ) }_{p-1} )_{n\geq 0}$ we similarly obtain 
\[ 
	q^{ ( i ) }_{ (p-1) p^n }/ p^{\chi_i + n }  \equiv q^{ ( i ) }_{(p-1) p^{\ell } } / p^{\chi_i +\ell } \pmod p
\] 
for any integer $n \geq 0$, since $q^{ ( i ) }_{ (p-1) p }/ p^{\chi_i + 1 }   \equiv q^{ ( i ) }_{p-1}  / p^{\chi_i}$ (mod $p$). Consequently we have 
\[
	q^{ ( i ) }_{(p-1) p^n } / p^{\chi + n}  \equiv  q^{ ( i ) }_{(p-1) p^\ell }/ p^{\chi +\ell} \pmod p
\]  
for each index $i$. Substituting these congruences into 
\[
 	c_1  q_{(p-1) p^\ell }^{(1)}/ p^{\chi +\ell} + \cdots  +  c_k q_{(p-1)  p^\ell }^{ (k) } / p^{\chi +\ell}\equiv 0 \pmod{p},
\]
which is equivalent to \eqref{for:3}, we complete the proof of the lemma. 
\end{proof} 
\begin{remark} 
	Let $p$ be an odd prime. For fixed integers $a$, $b$ satisfying $p\nmid ab$ and $p \mid a - b$, the classical LTE lemma states that $v_p(a^n - b^n) = v_p(n) + v_p(a - b)$. Hence, for each index $i$, we have $v_ p ( q^{ ( i ) }_{ (p-1) p^\ell } ) = \ell+ \chi_i$. Thus Lemma \ref{lem:5} does not follow from the LTE lemma since $ q^{ ( i ) }_{ (p-1) p^\ell }/p^{\ell +\chi} \not\equiv 0 $ $($mod $p)$ for some index $i$.
\end{remark} 
We are now ready to present a proof of Theorem \ref{thm:1}.
\begin{proof}[Proof of Theorem \ref{thm:1}]
For each $a_i$ which is prime to $p$ we set $c_i = a_i^\ell$ and define a sequence $( q_n^{( i )})_{n\geq 1}$ by $q_n^{( i )} = a^n_i -1$ for each integer $n\geq 1$. Then the assumption is clearly equivalent to the condition that
\begin{align}\label{for:4}
	\sum_{(a_i, p)=1} c_i q_{p-1}^{( i )} /p \not \equiv 0 \pmod{p}.
\end{align}
Under this condition we show the existence of an unbounded subsequence of $(v_p(s_n ))_{n\geq 1}$ by induction. We claim that there is an integer $N \geq 1$ such that 
\[
	v_p( s_N ) &gt; m \text{ and } N \equiv \ell \pmod{p-1} 
\]
for a fixed integer $m \geq 0$. Firstly, if $m=0$ then we choose $N = \ell$ which is the base case of our induction. Assume the claim holds for an integer $N$ such that $m = v_p( s_N ) &gt;0$. We now show that there is an integer $n$ such that $v_p(s_n) &gt; m$ and $n \equiv \ell \pmod{p-1}$. For this purpose we consider the set $S$ defined by 
\[
	S =\{ s_{n_t}  \mid  n_t = N + \varphi( p^{ m }) t, \   t = 1, 2, \ldots, p \},
\]	
where $\varphi$ denotes the Euler's totient function. It follows from Euler's theorem and the induction hypothesis that  $v_p( s_{n_t} ) \geq m$ for each $t$. Suppose each element of $S$ is not divisible by $p^{m +1}$. Then, by Pigeonhole principle, there are two different elements $s_{n_j}$ and $s_{n_{j + t}}$ of $S$ ($t\ne 0$) which are congruent modulo $p^{m + 1}$. Hence we obtain 
\[
		\sum_{(a_i, p)=1} c_i  q_{ t\varphi(p^m) }^{(i)} / p^m \equiv 0\pmod{ p }
\]
since $N \equiv \ell \pmod{p-1}$ and $j, t$  are non-zero integers. Clearly, we have 
\[
	q_{ \varphi(p^m)t}^{(i)} / p^m \equiv t q_{ \varphi(p^m)}^{(i)} / p^m \pmod p
\]
for each index $i$. Therefore, using these congruences, it follows from Lemma \ref{thm:2} that
\[
	\sum_{(a_i, p)=1} c_i q_{ \varphi(p)}^{(i)} / p \equiv 0 \pmod{p},
\]
contradicting \eqref{for:4}. Thus $S$ contains an element $s_{n_t}$ satisfying $v_p( s_{n_t}) \geq m + 1$. Clearly, $n_t \equiv \ell \pmod{p-1}$ by the induction hypothesis. This completes the induction step.
\end{proof} 
\begin{remark}
	Theorem \ref{thm:1} provides a sufficient but not necessary condition: consider the sequence $( s_n)_{n\geq 1}$ given by $s_n = 1+2^n + 3^n$ for all $n\geq 0$. Set $p=7$. Then 
\[
	s_4 \equiv 2^4 (2^{p-1}-1)/p + 3^4 (3^{p-1}-1)/p \equiv 0\pmod{p},
\] 
	but the subsequence $(v_p(s_{4p^n}))_{n\geq 1}$  is unbounded since $v_p(s_{4p^n}) = n+2$ for each $n\geq 0$.
\end{remark}
\begin{corollary}\label{lem:6}
	Let $p$ be a prime divisor of the sequence $( s_n)_{n\geq 1}$. Assume that $a_1, a_2, \ldots, a_k$ and $k$ are not divisibly by $p$ and $v_p(s_\ell)=1$ for each $s_\ell$  such that $1\leq \ell &lt; p$ and $p\mid s_\ell$. Then the sequence $( v_p( s_n ))_{n\geq 1}$ is bounded by 1 if and only if \eqref{for:1} does not hold.
\end{corollary}
\begin{proof}
If $( v_p( s_n ))_{n\geq 1}$ is bounded then Theorem \ref{thm:1} implies that \eqref{for:1} does not hold.

Suppose \eqref{for:1} does not hold. For any integers $n, j\geq 1$ we have 
\[
	s_{n + \varphi(p) j } = \sum a_i^n (p q(a_i)+1)^j
\] and hence
\begin{align}\label{for:5}
		 s_{n + \varphi(p) j } \equiv s_n   \pmod{p^2}
\Longleftrightarrow
		\sum_{i=1}^k a_i^n q  (a_i)  \equiv 0 \pmod{p}.
\end{align} 
If $v_p(s_n) \ne 0$ then $v_p(s_\ell) \ne 0$, where $\ell$ is an integer satisfying $n = \ell + \varphi(p) j$ with $0&lt; \ell &lt; \varphi(p)$. Therefore \eqref{for:5} implies that $v_p(s_n) = 1$ and thus  the sequence $(v_p(s_n))_{n\geq 1}$ is bounded by $1$.
\end{proof} 

\begin{example} 
	Let $a_1=6$, $a_2=13$, $a_3=97$ and $p=19$. Clearly, if $\ell&lt;p$ and $p\mid s_\ell$ then $\ell = 2$. Moreover, $v_p(s_2)=1$ and the sum
\[
	a_1^2 (a_1^{p-1}-1)/p + a_2^2 (a_2^{p-1}-1)/p + a_3^2 (a_3^{p-1}-1)/p
\] 
	is divisible by $p$. Thus, by Corollary \ref{lem:6}, each term of the sequence $(s_n)_{n\geq 1}$ is not divisible by  $p^2$.
\end{example}
 
\section {Acknowledgment}\label{acknowledge}
The authors would like to thank the referee for carefully reading the paper. The research has received funding from the National University of Mongolia under grant agreement P2020-3943. 
\begin{thebibliography}{5}
 
	\bibitem{AS} 
	J.-P. Allouche and J. Shallit, 
	The ring of $k$-regular sequences, 
	{\em Theoret. Comput. Sci.} 
	{\bf 98} (1992), 
	163--197.

	\bibitem{B}  J. P. Bell, 
	$p$-adic valuations and $k$-regular sequences, 
	{\em Discrete Math.} 
	{\bf  307} (2007), 
	3070--3075.

	\bibitem{BV}  
	G. D. Birkhoff and H. S. Vandiver, 
	On the integral divisors of $a^n - b^n$, 
	{\em Ann. of Math.} 
	{\bf 5} (1904), 
	173--180.

	\bibitem{Len1}  
	T. Lengyel, 
	Exact $p$-adic orders for differences of Motzkin numbers,
	 {\em Int. J. Number Theory}  
	 {\bf 10}  (2014), 
	 653--667.

	\bibitem{Len2}  
	T. Lengyel,  
	On divisibility properties of some differences of the central binomial coefficients and catalan numbers, 
	{\em Integers} 
	\textbf{13}  (2013), 
	A10.

	\bibitem{MS}  
	N. Murru and C. Sanna, 
	On the $k$-regularity of the $k$-adic valuation of Lucas sequences,
	 {\em J.\ Th\'eor.\ Nombres Bordeaux} 
	 {\bf 30} (2018), 
	 227--237.

	\bibitem{R1}  
	P. Ribenboim, 
	On square factors of terms of binary recurring sequences and the $ABC$ conjecture,  
	{\em Publ. Math. Debrecen} 
	{\bf 59}  (2001), 
	459--469.

	\bibitem{R2}  
	P. Ribenboim, 
	{\em My Numbers, My Friends}, 
	Springer-Verlag, 2002.

	\bibitem{San}   
	C. Sanna, 
	The $p$-adic valuation of Lucas sequences, 
	{\em Fibonacci Quart.}  
	\textbf{54} (2016),  
	118--124.

\end{thebibliography}

\bigskip
\hrule
\bigskip

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

\medskip
	
\noindent 
\emph{Keywords}:~sums of powers of integers,
$p$-adic valuation,
Lucas sequence.
	
\bigskip
\hrule
\bigskip

\vspace*{+.1in}
\noindent
Received  July 11 2022;
revised versions received  August 5 2022; August 31 2022; September 13 2022.
Published in {\it Journal of Integer Sequences}, October 7 2022.

\bigskip
\hrule
\bigskip

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


\end{document}
</pre></body></html>