{'fraction_non_alphanumeric': 0.06021746347941567, 'fraction_numerical': 0.02141434262948207, 'mean_word_length': 3.4508681196896935, 'pattern_counts': {'":': 0, '<': 42, '<?xml version=': 0, '>': 37, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 41, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
On arithmetic progressions in Lucas sequences

In this paper, we consider arithmetic progressions contained in Lucas sequences of first and second kind. We prove that for almost all sequences, there are only finitely many and their number can be effectively bounded. We also show that there are only a few sequences which contain infinitely many and one can explicitly list both the sequences and the progressions in them. A more precise statement is given for sequences with dominant root.


Introduction
The study of additive structures in certain sets of integers has a long history. In particular, the description of arithmetic progressions has attracted the attention of many researchers and is still an actively studied topic with a vast literature. Without trying to be exhaustive and going into details we only mention a few interesting directions.
Bremner [4] found infinitely many elliptic curves such that among the first coordinates of rational points one can find an eight-term arithmetic progression. Campbell [5], modifying ideas of Bremner, gave the first example of a progression of length twelve which was later improved to fourteen by MacLeod [11]. For more details on the various generalizations to other families of curves and recent progress we refer to the paper of Ciss and Moody [6] and the references given there.
The study of arithmetic progressions in solution sets of Pellian equations is another interesting direction. Dujella, Pethő and Tadić [7] showed that for every four term arithmetic progression (y 1 , y 2 , y 3 , y 4 ) = (0, 1, 2, 3) there exist infinitely many pairs (d, m) such that the equation x 2 − dy 2 = m admits solutions with y = y i for i = 1, 2, 3, 4. On the other hand, Pethő and Ziegler [12] proved that for five-term arithmetic progressions only a finite number of such equations are possible. For further progress we refer to the papers of Aguirre, Dujella and Peral [1] and González-Jiménez [10].
In this paper, we connect to the field by considering arithmetic progressions in Lucas sequences. Let A and B be non-zero integers such that the roots α and β of the polynomial satisfy that α/β is not a root of unity. Define the sequences u = (u n ) ∞ n=0 and v = (v n ) ∞ n=0 via the binary recurrence relations u n+2 = Au n+1 + Bu n and v n+2 = Av n+1 + Bv n (n ≥ 0) (2) with initial values u 0 = 0, u 1 = 1 and v 0 = 2, v 1 = A. We call u and v the Lucas sequences of first and second kind corresponding to the pair (A, B), respectively.
Remark 1. The classical definition of u and v requires gcd(A, B) = 1 which is needed for certain p-adic properties to hold. Hence our definition is more general.
The assumption on the roots of the companion polynomial (1) coincides with the non-degeneracy property. The study of all linear recurrences can effectively be reduced to such sequences, see [8].
The investigation of arithmetic progressions in linear recurrences is not a completely new topic. Pintér and Ziegler [13] gave a criterion for linear recurrences of general order to contain infinitely many three term arithmetic progressions. Note that the study of three term arithmetic progressions is the first non-trivial problem and is the most general. Further, they proved that the sequence of Fibonacci and Jacobsthal numbers are the only increasing Lucas sequences having infinitely many three term progressions.
In this paper, we connect to the results of Pintér and Ziegler. On one hand, we give an upper bound for the number of three term arithmetic progressions provided that there are only finitely many. On the other hand, we explicitly list all those sequences which contain infinitely many arithmetic progressions. Finally, by restricting ourselves to sequences with companion polynomials having a dominant root, we find all sequences which contain a three term arithmetic progression and give a complete list of the occurrences.
Remark 3. We expect that the upper bound in Theorem 1 is very far from being sharp. It would be an interesting problem to study the average number of three term arithmetic progressions in Lucas sequences of the first and second kind.
By imposing stronger restrictions on the sequences we can state much more. Namely, if the characteristic polynomial (1) has a dominant root, then it is possible to explicitly list all three term arithmetic progressions in the corresponding sequence.
be the Lucas sequences of first and second kind, respectively, corresponding to the pair (A, B). Assume that A 2 + 4B > 0. Then u and v admit no three term arithmetic progression, except the cases listed in Tables 1 and 2, respectively.
As an immediate consequence of Theorem 2 we have the following: ) be the Lucas sequence of first (resp. second) kind corresponding to the pair (A, B). Assume that A 2 + 4B > 0. If u (resp. v) contains more than two (resp. one) three term arithmetic progressions, then u (resp. v) contains infinitely many three term arithmetic progressions.
The ineffective methods we use in the proof of Theorem 1 do not give such sharp bounds as in Corollary 1. However, it would be interesting to find optimal bounds also in the general case, i.e., if we drop the condition A 2 + 4B > 0 in Corollary 1.
(1, 0, 2) Table 2: (A, B) which we treat one by one, usually in an elementary way. The proof of Theorem 1 in Section 3 is based on the theory of S-unit equations.

The dominant root case
This section is devoted to the case, where A 2 + 4B > 0, that is, the roots of the companion polynomial are real. First, we remark that in any linear recurrence, the terms can be represented as polynomial-exponential sums depending on the roots of the companion polynomial. In our situation, this leads to the well-known formulas u n = α n − β n α − β and v n = α n + β n (n ≥ 0).
We will regularly use this definition of Lucas sequences instead of the recurrence relation (2). The following lemma concerns equations satisfied by three term arithmetic progressions.
Lemma 1. Let u = (u n ) ∞ n=0 be any sequence. Suppose that for some n 0 we have |u n /u n ′ | > 3 for every n > n 0 and every n ′ < n. If m > n 0 , then neither of the equations has a solution (k, l, m) with k < l < m. In particular, u does not admit any three term arithmetic progression with terms corresponding to the indices k, l and m with max{k, l, m} > n 0 .
Proof. Assuming that n 0 < m gives us either 3|u k | < 3|u l | < |u m | or 3|u l | < 3|u k | < |u m |. In the former case, we have Thus the first equation of (3) has no solution with k < l < m. In an analogous way, one can get the same deduction for 3|u l | < 3|u k | < |u m | and it is easy to see that the second and third equations of (3) are unsolvable as well.
We are in need of a good criterion for the applicability of Lemma 1.
Lemma 2. Let u = (u n ) ∞ n=0 be the Lucas sequence of first kind corresponding to the pair Proof. Under our conditions the polynomial X 2 − AX − B has a dominant root, say α. Note that if |A| > 6 or |B| > 9, then we have |α| > 3 and may write Observe that there are trivial cases. These include θ > 0 and also θ < 0 when n is odd. What remains to consider is the case when θ < 0 and n is even. Next, we show that the quotients |u 2n+2 /u 2n+1 | increase with n, that is, they satisfy the inequality Equivalently, we may write Since 0 < |θ| < 1, it reduces to Collecting the terms on the left hand side and dividing both sides of the inequality by −θ 2n−1 > 0 we obtain which is obviously true for any θ with 0 < |θ| < 1. Since |u 2 /u 1 | = |A| ≥ 1, we have, in particular, that |u n /u n−1 | > 1 for all n ≥ 0. This proves the lemma for all odd n and all n > 2n 0 with |u 2n 0 /u 2n 0 −1 | > 3. Thus we need to show that |u 8 /u 7 | > 3 under our hypotheses.
We need to show that The inequality holds unless y ≤ 3. However, y ≤ 3 is impossible, since it would imply B ≤ 0 which we excluded.
Similar arguments for the cases |A| = 2 and |A| = 1 yield that u 8 u 7 > 3 provided that B > 9 and B > 3, respectively.
A similar argument for Lucas sequences of second kind reveals the following.
be the Lucas sequence of second kind corresponding to the pair (A, B), with A 2 + 4B > 0. Assume that n > n ′ . Then |u n /u n ′ | > 3 if n is even or n ≥ 7, unless Proof. Since the proof of this Lemma is similar to that of Lemma 2, we omit most of the details. Note that when |A| = 1 we have |v 1 /v 0 | = 1/2 < 1 and we can only deduce |v n /v n−1 | ≥ 1 provided that n ≥ 2. Thus we shall ensure |v 7 | ≥ 6. Direct computation yields that indeed |v 7 | = 7B 3 + 14B 2 + 7B + 1 when |A| = 1. Since |A| = 1 implies that B ≥ 1, we get |v 7 | > 6.
Now we apply Lemma 1 in combination with Lemma 2 and find that if u admits a three term arithmetic progression, then one of the equations in (3) must have a solution with even m ≤ 6. Writing the terms of u as polynomials in A and B we have to deal with finitely many equations. We only present the main ideas through one example for each different type of possible equations, we treat the rest in a similar manner.
Case m = 4. The corresponding equations are linear in B. For example, the triple (k, l, m) = (1, 2, 4) substituted into the second equation of (3) gives us Hence A | 2, i.e., A = ±1, ±2. However, we see that one of the conditions AB = 0 and A 2 + 4B > 0 fails in all cases. One can handle the other equations similarly.
Case m = 6. The corresponding equations are quadratic in B. Our general strategy is to push the discriminant of each equation between two squares and solve the parametric equation for each square between these lower and upper bounds. For example, the triple (k, l, m) = (0, 3, 6) and the third equation of (3) gives The discriminant is D = 16A 6 + 8A 3 + 1 = (4A 3 + 1) 2 . However, solving this for B we get the pair (A, B) = (A, −A 2 ) and A 2 + 4B > 0 fails to hold.
Let us consider another example. For instance, take the triple (k, l, m) = (0, 2, 6). Then we obtain D = A 6 + 6A 2 − 3A. But provided that |A| > 3 and we deduce that D is never a square if |A| > 3. For those with |A| ≤ 3 and A = 0 we obtain that D is a square if and only if A = 1. In this case, B = 0 which contradicts our assumption.
The same approach for each triple gives the complete list of three term arithmetic progressions.
In these finitely many cases, we can use a growth argument to find all three term arithmetic progressions. Let us demonstrate this by an example, say A = 2 and B = 1 and (u n ) ∞ n=0 being a Lucas sequence of first kind. One may handle all the other finitely many equations by a similar reasoning. First note that in this specific case we have that α = 1 + √ 2 and β = 1 − √ 2. Assume that u k < u l < u m is a three term arithmetic progression and consider the first equation of (3) which is equivalent to Let us assume for the moment that m > l + 1 > k + 1. Then Plugging in the concrete values of α and β we immediately get which yields a contradiction unless m < 3. Now it is easy to find all three term arithmetic progressions in this case. Note that in case of l > m or k > m we may draw similar conclusions.
Hence we can assume that m = l + 1 > k + 1. Then |α| m − 2|α| m−1 < |α| k + 4|β| k and inserting the concrete values of α and β we get whence m ≤ 4 and we easily find all three term arithmetic progressions listed in Table 1 for this case. Finally, we have to consider the case when m = l + 1 = k + 2. Here we get the inequality that is, m ≤ 3 and we find no additional three term arithmetic progressions. Similar arguments for different orderings of u k , u l , u m reveal no further solutions. Thus the case A = 2 and B = 1 is completely solved.
3 The case A 2 + 4B < 0 Unfortunately, we found no effective method to resolve this case completely. The reason has its roots in the use of the theory of S-unit equations. Indeed, the indices k, l, m corresponding to a non-trivial arithmetic progression u k < u l < u m contained in a Lucas sequence (u n ) ∞ n=0 of first kind or a Lucas sequence (v n ) ∞ n=0 of second kind satisfies the Diophantine equation where the ± sign depends on whether we consider Lucas sequences of first or second kind. In view of Theorem 1, it is crucial to discuss the number of solutions to S-unit equation (4). In the real case (cf. Section 2), we resolved this S-unit equation by using the fact that |α| > |β| and that u n u n−1 ≃ |α| as n → ∞. If A 2 + 4B < 0, then this is no longer true and we have to apply the deep theory of S-unit equations.
In order to determine an upper bound for the number of solutions we prove a series of Lemmas which culminate in a proof for Theorem 1.
Before we start with the first lemma, let us note that both α and β are algebraic integers. Moreover, due to Theorem 2, which was proved in the previous section, we may assume that α and β are conjugate imaginary quadratic integers. Hence we can suppose that α and β are not units, otherwise α/β would be a root of unity. Thus we may suppose that |B| ≥ 2. Write K = Q(α) = Q(β) and denote by σ the unique, nontrivial Q-automorphism of K, i.e., Gal(K/Q) = {id, σ}. Since K is an imaginary quadratic field, we also have that σ(ǫ) = ǫ −1 , where ǫ is any unit in K.
For fixed α and β we denote by C 1 and C 2 the number of non-trivial three term arithmetic progressions of (u n ) ∞ n=0 and (v n ) ∞ n=0 , respectively and write C = max{C 1 , C 2 }. Actually, our upper bounds for C 1 and C 2 coincide in each instance and hence we use only the quantity C.
with a 0 , . . . , a r ∈ C, in unknowns u 0 , . . . , u r ∈ Γ. By a non-degenerate solution we mean a solution to equation (5) such that no subsum on the left hand side of equation (5) vanishes. Upper bounds A(a 0 , . . . , a r ) ≤ A(r, s), where s denotes the rank of Γ, have been found most prominently by Evertse, Schlickewei and Schmidt [9] and Amoroso and Viada [2] in the most general case. In particular, we use the bounds due to Schlickewei and Schmidt [14] which in our case yield better results although they depend on d = [K : Q], as well. As already noted above, three term arithmetic progressions in the Lucas sequences (u n ) ∞ n=0 and (v n ) ∞ n=0 yield solutions to (4). Thus we study the weighted S-unit equation where x 1 , x 2 , x 3 , y 1 , y 2 , y 3 ∈ Γ = α, β and, in particular, where x 1 = α k , x 2 = α m , x 3 = α l , y 1 = β k , y 2 = β m , y 3 = β l . Before we start investigating S-unit equations of type (6) we state a theorem due to Beukers [3, Theorem 2] and draw some simple conclusions from it.
Lemma 4 (Beukers [3]). Let the non-degenerate recurrence sequence of rational integers (u n ) ∞ n=0 be given by u 0 ≥ 0, gcd(u 0 , u 1 ) = 1, u n = Au n−1 − Bu n−2 , with A, B ∈ Z and A ≥ 0. Assume that A 2 − 4B < 0. If u m = ±u 0 has more than three solutions m, then one of the following cases holds: From this Lemma we can easily conclude the following statement. Proof. Let m 0 be the smallest solution to λ = u m . Consider instead of the original sequence the sequence a k = u m 0 +k /g(−1) kδ , where g = sign(u m 0 ) gcd(u m 0 , u m 0 +1 ) and δ = 1−sign(A) 2 (see also the remarks following Theorem 2 in [3]). Therefore we conclude that an equation of the form λ = |u m | has more than three solutions if for the smallest solution m 0 , also m 0 + 1 is a solution and (A, B) = (±1, −2), (±3, −4) or (±2, −3).
However, the equation |u m 0 | = |u m 0 +1 | is equivalent to the equation in case that (u n ) ∞ n=0 is a Lucas sequence of first kind and α ± 1 is a Lucas sequence of second kind. For all pairs of (α, β) we solve these equations and find for instance, that m 0 ≤ 2 (if a solution exists at all). By computing the values of all possible further solutions we find that indeed no equation of the form λ = u m has more than three solutions. Lemma 6. There are at most A(5, 2) three term arithmetic progressions contained in a Lucas sequence (u n ) ∞ n=0 of first kind that yield non-degenerate solutions to (4). The same statement also holds for Lucas sequence (v n ) ∞ n=0 of second kind. Proof. Consider the weighted S-unit equation with unknowns x 1 , x 2 , x 3 , y 1 , y 2 , y 3 ∈ Γ. This has at most A(5, 2) non-degenerate, projective solutions. Thus there exists a set C, with |C| ≤ A(5, 2), of sextuples (1, c 2 , c 3 , c 4 , c 5 , c 6 ) such that for any solution we have Assume now that a solution comes from an arithmetic progression u k < u l < u m in a Lucas sequence (u n ) ∞ n=0 of first kind. Then we have for some (1, c 2 , c 3 , c 4 , c 5 , c 6 ) ∈ C. Since by assumption α/β is not a root of unity, for every sextuple (1, c 2 , c 3 , c 4 , c 5 , c 6 ) ∈ C, there exists at most one triple (k, l, m) such that any set of identities of (8) is satisfied, i.e., u k < u l < u m is an arithmetic progression. Hence there exist at most A(5, 2) three term arithmetic progressions in a Lucas sequence of first kind (u n ) ∞ n=0 , yielding a non-degenerate solution to (4).
In the case of a Lucas sequence of second kind (v n ) ∞ n=0 , we consider instead of (7) the Diophantine equation and derive the same conclusion as before.
Before we start dealing with vanishing subsums in equation (4) we note that α and β are always multiplicatively independent. Otherwise, we would have α t = β s for some integers t, s. Taking the conjugates we get α s = β t and hence (α/β) t+s = 1 which we did not allow in the definition.
To deal with vanishing two-term subsums we use the following lemma.

Lemma 7.
For fixed non-zero complex numbers a, b and c either there exists at most one solution x, y ∈ Z to a x = cb y or a and b are multiplicatively dependent.
Proof. Assume that two distinct solutions x, y and x ′ , y ′ exist. Then we have Thus a and b are multiplicatively dependent since by assumption at least one exponent does not vanish.
In view of Lemma 6, we are left to deal with vanishing subsums, which may occur in equation (4). Of course, no one-term vanishing subsum exists. First, consider two-term vanishing subsums.
Lemma 8. There are at most 3A(3, 2) + 30 three term arithmetic progressions in a Lucas sequence (u n ) ∞ n=0 of first kind or a Lucas sequence (v n ) ∞ n=0 of second kind that yield a solution to (4) such that a two-term subsum vanishes.
Proof. First, we consider the Lucas sequences (u n ) ∞ n=0 of first kind. In this case, there exist exactly 15 possible vanishing two-term subsums in equation (4). We can divide these 15 subsums into five classes, namely Case III x 1 = 2x 3 , x 2 = 2x 3 , y 1 = 2y 3 , y 2 = 2y 3 , Case V x 1 = y 1 , x 2 = y 2 , x 3 = y 3 , For each one we pick an equation and discuss it in detail. Since one can treat the other equations in the same class by exactly the same arguments, we do not give details for them. Case I: The equation x 1 = −x 2 implies that α k = −α m and we get α k−m = −1. Thus α and hence β are roots of unity, which is excluded. Case II: The equation x 1 = y 2 implies that α k = β m , i.e., α and β are multiplicatively dependent, which cannot be the case. Case III: The equation x 1 = 2x 3 implies that α k = 2α l , i.e., α k−l = 2. Thus α = ± √ 2 or α = 2, both a contradiction to our assumption that α is imaginary quadratic. Case IV: If x 1 = −2y 3 we get the equation α k = −2β l and an by an application of Lemma 7 there exists at most one pair (k, l) satisfying α k = −2β l or α and β are multiplicatively dependent. The latter is not possible. However, if the pair (k, l) is fixed then u l and u k and therefore also u m is fixed. Due to Lemma 5 there are at most three possiblities for m, i.e., there are at most three ways to extend the pair (k, l) to a triple (k, l, m) such that u k < u l < u m is an arithmetic progression. Case V: If x 1 = y 1 , then we have α k = β k and therefore (α/β) k = 1. Hence α/β is a root of unity unless k = 0.
So far we have proved that one of the following statements holds: • we obtain at most 12 additional solutions coming from Case IV, • klm = 0.
Concerning the last case we assume that k = 0 first. We get the S-unit equation By the same arguments as in the proof of Lemma 6 we obtain that there are at most A(3, 2) three term arithmetic progressions which come from non-degenerate solutions of (9). Further, we have two vanishing two-term subsums falling into Case III, two falling into Case IV and two into Case V. Case III yields no additional solutions. Case IV yields at most 3 additional solution, hence in total at most six additional solutions. Finally, note that in Case V we can now exclude that l or m vanishes, otherwise we would obtain k = l or k = m and we get no additional solution. Thus k = 0 yields at most A(3, 2) + 6 additional solutions. By the same arguments it is possible to treat the cases of l = 0 and m = 0. We omit the details. However, the case that klm = 0 yields at most 3A(3, 2) + 18 additional solutions. Therefore we have at most 3A(3, 2) + 30 solutions.
Let us note that the proof of Lemma 8, in particular its last part, shows the following.
Lemma 9. There are at most A(3, 2) + 6 three term arithmetic progressions u k < u l < u m in a Lucas sequence of first or second kind such that k = 0. The same statements hold if we replace k = 0 by m = 0 or l = 0, respectively.
Since a vanishing four-or five-term subsum implies a two-or one-term vanishing subsum, respectively, we are left to consider vanishing three term subsums.
Lemma 10. At least one of the following statements holds: • There are at most 18A(2, 2) + 9 three term arithmetic progressions in a Lucas sequence of first or second kind that yield a solution to (4) such that a three term subsum vanishes, • or α and β are quadratic irrational numbers and if u k < u l < u m is an arithmetic progression, then the companion polynomial of the Lucas sequence (u n ) ∞ n=0 of first kind divides X k − 2X l + X m , • or α and β are quadratic irrational numbers and if v k < v l < v m is an arithmetic progression, then the companion polynomial of the Lucas sequence (v n ) ∞ n=0 of second kind divides X k − 2X l + X m .
Proof. Let us consider the case of Lucas sequences of first kind. Lucas sequences of second kind can be treated by the same means.
Finally, we turn to equations of type III and consider the first equation of this type in detail. We can handle the others similarly. Assume for the moment that there exists a prime ideal p with p ∤ (2) and v p (α) > 0. Let p 2 be a prime ideal lying above (2) and suppose that m > k. We consider the equation x 1 + x 2 = −2y 3 from a p-adic point of view. Write v p (α) = ξ p and v p (β) = η p . Since the two smallest p-adic valuations of the summands have to coincide, we have v p (x 2 ) = kξ p = lη p = v p (2y 3 ). Considering p 2 -adic valuations we obtain kξ p 2 = lη p 2 + δ, where δ = 1, 2 depending on whether (2) is ramified or not. We get the following system of linear equations kξ p 2 − lη p 2 = δ kξ p − lη p = 0 which has either no solution or at most one solution. Note that by assumption ξ p > 0. Thus in this case, equations of type III yield at most one pair (k, l) that extends to a triple (k, l, m) such that u k < u l < u m is an arithmetic progressions. Thus by Lemma 5 we have at most three additional three term arithmetic progression.
In view of the paragraph above, we may assume that the only prime ideals dividing (α) and (β) are lying above (2). We distinguish now whether (2) splits, ramifies or is inert above K.
We start with the case when (2) is inert, i.e., (2) is a prime in K. Then (α) = (2) x and (β) = (2) y with some non-negative integers x, y. Since α and β are conjugate, we get x = y. Hence α/β is a unit. However, recalling that α, β are from a quadratic imaginary field, this yields that α/β is a root of unity, which is a contradiction.
One may prove the case where (2) ramifies by similar means as the inert case. In this case,we have (2) = p 2 with some prime ideal p. Note that p need not be principal although p 2 is principal. Thus (α) = p x and (β) = p y with some non-negative integers x, y. Taking norm, we get x = y, and similarly as above we obtain that α/β is a root of unity, which is impossible.

Acknowledgment
The authors are grateful to the referee for her/his useful comments and suggestions.