OFFSET
1,2
LINKS
T. D. Noe, Table of n, a(n) for n=1..1000
A. Murthy, Exploring some new ideas on Smarandache type sets, functions and sequences, Smarandache Notions Journal Vol. 11 N. 1-2-3 Spring 2000.
MAPLE
with(numtheory); i:=4; k:=5; while(k < 100) do while(order(k, i) = FAIL or isprime(k)) do k:=k+1; end do; print(k); i:= k; k:=k+1; end do; # Ben Paul Thurston, Feb 08 2007
MATHEMATICA
rPrimeNext[n_]:=Module[{k}, k=n+1; While[PrimeQ[k]||GCD[n, k]!=1, k++ ]; k]; a=1; lst={a}; Do[AppendTo[lst, a=rPrimeNext[a]], {n, 0, 5!}]; lst (* Vladimir Joseph Stephan Orlovsky, May 15 2010 *)
nxt[n_]:=Module[{k=n+1}, While[PrimeQ[k]||!CoprimeQ[k, n], k++]; k]; NestList[ nxt, 1, 60] (* Harvey P. Dale, Mar 12 2013 *)
PROG
(Haskell)
a051884 n = a051884_list !! (n-1)
a051884_list = 1 : f 1 a002808_list where
f x cs = y : f y (dropWhile (<= y) cs) where
y = head [z | z <- cs, x `gcd` z == 1]
-- Reinhard Zumkeller, Jun 03 2013
CROSSREFS
KEYWORD
nonn,nice,easy
AUTHOR
Felice Russo, Dec 15 1999
EXTENSIONS
More terms from James A. Sellers, Dec 16 1999
Definition corrected by Franklin T. Adams-Watters, Sep 19 2006
STATUS
approved