OFFSET
0,2
LINKS
Harvey P. Dale, Table of n, a(n) for n = 0..1000
EXAMPLE
a(7) = 50, and 8^2 is 64. So for a(8) we want the smallest integer that is both coprime to 50 and is > 64. Checking: 65 is not coprime to 50. 66 is not coprime to 50. But 67 is coprime to 50, so a(8) = 67.
MATHEMATICA
nxt[{n_, a_}]:=Module[{k=(n+1)^2+1}, While[!CoprimeQ[a, k], k++]; {n+1, k}]; Transpose[NestList[nxt, {0, 1}, 50]][[2]] (* Harvey P. Dale, Dec 28 2015 *)
FoldList[Function[{k, m}, SelectFirst[m^2 + Range@ 30, CoprimeQ[k, #] &]], 1, Range@ 50] (* Michael De Vlieger, Sep 23 2017 *)
CROSSREFS
KEYWORD
nonn
AUTHOR
Leroy Quet, Feb 28 2009
EXTENSIONS
Extended by Ray Chandler, Jun 19 2009
STATUS
approved