In this paper we obtain a simple formula for the number of matching
![$p$](img2.svg)
-ary digits of certain terms of Lucas sequences for any odd prime
![$p$](img2.svg)
. 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}$](img3.svg)
to be unbounded, where
![$a_1, a_2, \ldots, a_k$](img4.svg)
(
![$k \geq 2$](img5.svg)
) are given integers and
![$v_p$](img6.svg)
is the
![$p$](img2.svg)
-adic valuation.