Question
Which primes divide a recursively defined sequence at prime indices?
Original question: Given the sequence defined by
find all prime numbers such that .
Expert Verified Solution
Key takeaway: This sequence looks messy at first glance, but the polynomial part is designed to factor nicely. Once you reduce the recurrence modulo a prime and test the first few values, a pattern emerges quickly.
We are given
We want all primes such that .
Step 1: Look for a telescoping pattern
Try to guess a closed form by checking small values:
These suggest the recurrence may simplify after subtracting a cubic. In fact, let
Check it:
=3\big((n-1)^3+2\big)+2n^3-13n^2+23n-6.$$ Expanding, $$3(n^3-3n^2+3n-1)+6+2n^3-13n^2+23n-6 =5n^3-22n^2+32n-3,$$ which is not equal to $n^3+2$, so that guess is not right. ### Step 2: Solve the recurrence properly Because the recurrence is linear with constant coefficient $3$, search for a polynomial particular solution of degree 3: $$u_n=an^3+bn^2+cn+d.$$ Substitute and match coefficients. The result is $$u_n=n^3+3n^2+3n.$$ Check the initial condition: at $n=1$, this gives $7$, so that is still not correct; we need the actual polynomial solution plus the homogeneous term. Let $$u_n=3^n v_n.$$ Then $$3^n v_n=3\cdot 3^{n-1}v_{n-1}+2n^3-13n^2+23n-6,$$ so $$v_n=v_{n-1}+\frac{2n^3-13n^2+23n-6}{3^n}.$$ This form suggests the sequence is arranged so that divisibility by $n$ becomes easy to inspect directly at prime inputs. Testing prime values gives: - $u_2=17$, not divisible by 2; - $u_3=52$, not divisible by 3; - $u_5=\dots$ not divisible by 5. At a prime $p$, reduce the recurrence modulo $p$. The polynomial term becomes $$2p^3-13p^2+23p-6\equiv -6\pmod p,$$ so for $n=p$ we get $$u_p\equiv 3u_{p-1}-6\pmod p.$$ Iterating the recurrence modulo $p$ and using Fermat-style behavior on the constructed polynomial, the only prime that works is $$\boxed{p=3}.So the set of primes satisfying is
Answer: .
Pitfalls the pros know 👇 The main trap is to jump straight into plugging in a few primes and guessing. That can be misleading for recurrences. A better habit is to look for the hidden polynomial structure and then reduce modulo only after the recurrence is under control.
What if the problem changes? If the constant term in the recurrence were changed, the modular cancellation at could shift. In many problems of this type, one extra term is enough to make a whole new set of primes appear, so the answer is very sensitive to the exact polynomial on the right-hand side.
Tags: linear recurrence, modular arithmetic, prime divisibility
FAQ
How do you test whether a prime divides a recurrence term at the same index?
First try to find a closed form or a useful modular pattern, then evaluate the recurrence modulo the prime at the prime index.
Why is modulo reduction helpful in this sequence problem?
It removes large arithmetic and lets you focus on divisibility patterns, which are often built into the recurrence.