Can recurrences involving $\gcd$ be solved?

34 Views Asked by At

Can recurrences of the form $$ \sum_{i=1}^n a_iX_i=\gcd(n, X_n) $$

Where $a_i$ are constant coeficients. $a_i,X_i$ are integers. $a_n\neq0$.

For $n \geq 2$ be solved?

Here is an example:

$$ X_n=X_{n-1}+\gcd(n, X_{n-1}). X_1=7 $$

This example produces only prime numbers, and recurrences like this arose in some exercises I was working on. I want to know if a closed form is possible.