OFFSET
0,2
LINKS
Michael De Vlieger, Table of n, a(n) for n = 0..10000
EXAMPLE
a(8) = 20, and the 9th prime is 23. So for a(9) we want the smallest integer that is both coprime to 20 and is > 23. Checking: 24 is not coprime to 20. 25 is not coprime to 20. 26 is not coprime to 20. But 27 is coprime to 20, so a(9) = 27.
MATHEMATICA
Fold[Append[#1, Block[{k = Prime@ #2 + 1}, While[! CoprimeQ[k, #1[[-1]] ], k++]; k]] &, {1}, Range@ 59] (* Michael De Vlieger, Oct 30 2017 *)
sic[{n_, a_}]:=Module[{k=Prime[n+1]+1}, While[!CoprimeQ[a, k], k++]; {n+1, k}]; NestList[sic, {0, 1}, 60][[;; , 2]] (* Harvey P. Dale, Oct 22 2024 *)
CROSSREFS
KEYWORD
nonn
AUTHOR
Leroy Quet, Feb 28 2009
EXTENSIONS
Extended by Ray Chandler, Jun 19 2009
STATUS
approved