OFFSET
1,2
LINKS
Michael De Vlieger, Table of n, a(n) for n = 1..10000
EXAMPLE
8 has the prime-factorization of 2^3. The smallest integer > a(7)=8 that is coprime to both 8 and 3 is 11. (9 is not coprime to 3. 10 is not coprime to 8.) So a(8)=11.
MAPLE
A138308 := proc(n) option remember; local pfs, a, p, works ; if n = 1 then 1; else pfs := ifactors(n)[2] ; for a from procname(n-1)+1 do works := true ; if gcd(a, n) > 1 then works := false; else for p in pfs do if gcd(a, op(2, p)) > 1 then works := false; fi; end do ; end if; if works then return a; end if ; end do; end if; end: seq(A138308(n), n=1..120) ; # R. J. Mathar, Oct 24 2009
MATHEMATICA
Fold[Append[#1, SelectFirst[Range[#1[[-1]] + 1, #1[[-1]] + 12], Function[k, AllTrue[Join[{#2}, FactorInteger[#2][[All, -1]] ], CoprimeQ[k, #] &]]]] &, {1}, Range[2, 69]] (* Michael De Vlieger, Oct 18 2017 *)
CROSSREFS
KEYWORD
nonn
AUTHOR
Leroy Quet, Mar 13 2008
EXTENSIONS
Extended beyond a(14) by R. J. Mathar, Oct 24 2009
STATUS
approved