A168143 a(17)=37; for n>=17, a(n)=3n-14 if gcd(n,a(n-1))>1 and all prime divisors of n more than 17; a(n)=a(n-1)+1, otherwise.
37, 38, 43, 44, 45, 46, 55, 56, 57, 58, 59, 60, 61, 62, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157
Offset: 17
Keywords
Links
- Robert Israel, Table of n, a(n) for n = 17..10000
- E. S. Rowland, A natural prime-generating recurrence, Journal of Integer Sequences, Vol. 11 (2008), Article 08.2.8.
- V. Shevelev, A new generator of primes based on the Rowland idea, arXiv:0910.4676 [math.NT], 2009.
- V. Shevelev, Generalizations of the Rowland theorem, arXiv:0911.3491 [math.NT], 2009-2010.
Crossrefs
Programs
-
Maple
A[17]:= 37: q:= convert(select(isprime,[$2..17]),`*`); for n from 18 to 100 do if igcd(n,A[n-1]) > 1 and igcd(n,q) = 1 then A[n]:= 3*n-14 else A[n]:= A[n-1]+1 fi od: seq(A[i],i=17..100); # Robert Israel, Aug 21 2017
-
Mathematica
nxt[{n_,a_}]:={n+1,If[GCD[n+1,a]>1&&FactorInteger[n+1][[1,1]]>17,3(n+1)-14,a+1]}; NestList[nxt,{17,37},60][[All,2]] (* Harvey P. Dale, Aug 15 2017 *)
Extensions
Corrected by Harvey P. Dale, Aug 15 2017
Comments