Reminder: The OEIS is hiring a new managing editor, and the application deadline is January 26.
%I #33 Nov 23 2015 16:19:10
%S 1,5,10,5,1,9,18,9,1,13,26,13,1,17,34,17,1,21,42,21,1,25,50,25,1,29,
%T 58,29,1,33,66,33,1,37,74,37,1,41,82,41,1,45,90,45,1,49,98,49,1,53,
%U 106,53,1,57,114,57,1,61,122,61,1,65,130,65,1,69,138,69,1,73,146,73,1,77,154,77,1,81,162
%N a(1)=1; for n>1, a(n) = a(n-1) + n + 2 if a(n-1) and n are coprime, otherwise a(n) = a(n-1)/gcd(a(n-1),n).
%C This recurrence is quasi-periodic.
%C 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).
%C 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.
%C 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.
%H Benoit Cloitre, <a href="http://arxiv.org/abs/1101.4274"> 10 conjectures in additive number theory</a>, arXiv:1101.4274 [math.NT], 2011.
%H Eric S. Rowland,<a href="http://arxiv.org/abs/0710.3217"> A natural prime-generating recurrence</a>, arXiv:0710.3217 [math.NT], 2007-2008.
%F 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
%t 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 *)
%o (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))
%Y Cf. A091508, A106108, A133058, A133579, A133580, A255051, A255140.
%K nonn
%O 1,2
%A _Ctibor O. Zizka_, Oct 04 2015