%I #29 Nov 03 2019 20:18:37
%S 14,21,22,23,24,25,26,39,40,45,46,47,48,49,50,51,52,53,54,55,56,57,58,
%T 87,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,
%U 109,110,111,112,113,114,115,116,117,118,177,180,181,182,189,190,195
%N a(6) = 14, for n >= 7, a(n) = a(n-1) + gcd(n, a(n-1)).
%C For every n >= 7, a(n) - a(n-1) is 1 or prime. This Rowland-like "generator of primes" is different from A106108 (see comment to A167168).
%H G. C. Greubel, <a href="/A167170/b167170.txt">Table of n, a(n) for n = 6..1000</a>
%H Eric S. Rowland, <a href="http://www.cs.uwaterloo.ca/journals/JIS/VOL11/Rowland/rowland21.html">A natural prime-generating recurrence</a>, J. of Integer Sequences 11 (2008), Article 08.2.8.
%H V. Shevelev, <a href="http://arxiv.org/abs/0910.4676">An infinite set of generators of primes based on the Rowland idea and conjectures concerning twin primes</a>, arXiv:0910.4676 [math.NT], 2009.
%p A167170 := proc(n) option remember; if n = 6 then 14; else procname(n-1)+igcd(n,procname(n-1)) ; end if; end proc: seq(A167170(i),i=6..80) ; # _R. J. Mathar_, Oct 30 2010
%t RecurrenceTable[{a[n] == a[n - 1] + GCD[n, a[n - 1]], a[6] == 14}, a, {n, 6, 100}] (* _G. C. Greubel_, Jun 04 2016 *)
%t nxt[{n_,a_}]:={n+1,a+GCD[a,n+1]}; NestList[nxt,{6,14},60][[All,2]] (* _Harvey P. Dale_, Nov 03 2019 *)
%o (PARI) first(n)=my(v=vector(n-5)); v[1]=14; for(k=7,n, v[k-5]=v[k-6]+gcd(k,v[k-6])); v \\ _Charles R Greathouse IV_, Aug 22 2017
%Y Cf. A167168, A106108, A132199, A167054, A167053, A166944, A166945, A116533, A163961, A163963, A084662, A084663, A134162, A135506, A135508, A118679, A120293.
%K nonn
%O 6,1
%A _Vladimir Shevelev_, Oct 29 2009, Nov 06 2009
%E Terms > 91 from _R. J. Mathar_, Oct 30 2010
|