OFFSET
1,1
LINKS
Franklin T. Adams-Watters, Table of n, a(n) for n = 1..10000
PROG
(PARI) invecn(v, n, x)=for(k=1, n, if(v[k]==x, return(k))); 0
nexta(v, n)=local(k=n+2); while(gcd(k, n)>1||invecn(v, n-1, k), k++); k
al(n)=local(v=vector(n)); for(k=1, n, v[k]=nexta(v, k)); v
(Haskell)
a196189 n = a196189_list !! (n-1)
a196189_list = f 1 [] where
f n xs = x : f (n+1) (x:xs) where
x = head [z | z <- [n+2..], z `notElem` xs, gcd z n == 1]
-- Reinhard Zumkeller, Sep 29 2011
CROSSREFS
KEYWORD
nonn
AUTHOR
Franklin T. Adams-Watters, Sep 28 2011
STATUS
approved