OFFSET
1,2
COMMENTS
This recurrence is quasi-periodic.
For some choice of starting value a(1) there exists an integer t>=1 such that a(4*t-3)=1, a(4*t-2)=4*t+1, a(4*t-1)=2*(4*t+1), a(4*t)=4*t+1. The loop is (1,x,2x,x).
For some choice of starting value a(1) there exists an integer t>=1 such that a(2*t)=2*t-1 and a(2*t-1)=2*(2*t-1). The loop is (x,2x). See also A133058.
Quasi-periodic sequences exist only for R=0,1,2 or 3 in a(n) = a(n-1) + n + R. For R=0,1,2 all starting values give a quasi-periodic sequence. The respective loop is (1,x) for R=0, (1,x,2x,2) for R=1, (1,x,2x,x) or (x,2x) for R=2. For R=3 only some starting values converge to a 6-loop (4x+2,2x+1,3x+6,x+2,2x+9,3x+17). Conjecture: For R>=4 the recurrence is not quasi-periodic.
LINKS
Benoit Cloitre, 10 conjectures in additive number theory, arXiv:1101.4274 [math.NT], 2011.
Eric S. Rowland, A natural prime-generating recurrence, arXiv:0710.3217 [math.NT], 2007-2008.
FORMULA
Maple suggests the rational o.g.f. (-x^6 - x^5 - x^3 + 6x^2 + 4x + 1)/((x + 1)(x - 1)^2(x^2 + 1)^2), which should be easy to check. - _Pater Bala_, Oct 04 2015
MATHEMATICA
a[1] = 1; a[n_] := a[n] = If[CoprimeQ[a[n - 1], n], a[n - 1] + n + 2, a[n - 1]/GCD[a[n - 1], n]]; Array[a, {79}] (* Michael De Vlieger, Oct 05 2015 *)
PROG
(PARI) A=vector(1000, i, 1); for(n=2, #A, A[n]=if(gcd(A[n-1], n)>1, A[n-1]/gcd(A[n-1], n), A[n-1]+n+2))
CROSSREFS
KEYWORD
nonn
AUTHOR
Ctibor O. Zizka, Oct 04 2015
STATUS
approved