OFFSET
1,3
COMMENTS
At n = 499 the sequence settles down and becomes quasi-periodic with a 6-loop. Empiricaly 3 >= a(n + 1)/a(n) >= 1/3. The system is sensitive to the choice of initial terms [a(1),a(2)]. Only some values of initial terms results in a 6-loop like this sequence, the vast majority of initial terms show a "noisy quasiperiodic" like structures in the plot. Trials made for [a(1), a(2)] from [1, 1] to [100, 100] and for n up to 70000. May it be the sequence converges to a 6-loop for some large enough n, independent on the choice of initial terms ?
LINKS
Ray Chandler, Table of n, a(n) for n = 1..1000
Index entries for linear recurrences with constant coefficients, signature (1,-1,1,-1,1,0,0,0,0,0,0,1,-1,1,-1,1,-1).
FORMULA
For n >= 499:
if n mod 6 = 0, a(n) = 2*n - 1 + 2*((n/2) mod 2).
if n mod 6 = 1, a(n) = n + 2.
if n mod 6 = 2, a(n) = (n + 2)/2.
if n mod 6 = 3, a(n) = (n - 1)/2.
if n mod 6 = 4, a(n) = n - 2 - (n/2) mod 2.
if n mod 6 = 5, a(n) = 2*n - 6 + 3*((n + 1)/2 mod 2).
EXAMPLE
a(1) = 1
a(2) = 1
a(3) = floor(1*1/1) + GCD(1,1) = 2
a(4) = floor(2*2/1) + GCD(2,1) = 5
a(5) = floor(3*5/2) + GCD(3,2) = 8
and so on.
MATHEMATICA
a[n_] := a[n] = If[n < 3, 1, Floor[(n-2)*a[n-1]/a[n-2]] + GCD[n-2, a[n-2]]]; Array[a, 70] (* Amiram Eldar, Feb 20 2025 *)
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Ctibor O. Zizka, Feb 20 2025
STATUS
approved
