Let's define the radical of the positive integer $n$ as
$$\operatorname{rad}(n)=\prod\_{\substack{p\mid n\\ p\text{ prime}}}p$$
and consider the sequence
$$a\_{n+1}=\frac{\operatorname{rad}(p\cdot a\_{n})}{p}+\frac{\operatorname{rad}(q\cdot a\_{n-1})}{q}$$


with $\,a\_1=a\_2=1\,$ and $\,p,\,q\,$ odd primes.


In some cases the sequence is cyclic, that is
$$a\_{n+\tau}=a\_n$$
for all $\,n\gt n\_0$, being $\,\tau\,$ the cycle length.


Just two examples:


* for $\,(p,q)=(31,31),\;(n\_0,\tau)=(5,207)$
* for $\,(p,q)=(5,17),\;(n\_0,\tau)=(6,159)$


It is quite easy to find dozens of periodic sequences using small prime numbers: **in all cases, the length of the cycle turns out to be a multiple of 3. Is it possible to explain this singular behavior?**



Periodic sequences of integers generated by $a_{n+1}=\frac{\operatorname{rad}(pa_{n})}{p}+\frac{\operatorname{rad}(qa_{n-1})}{q}$
For any odd $p$, $q$ (not necessarily prime) the values modulo $2$ follow a cycle of order 3.


