OFFSET
1,2
LINKS
Alois P. Heinz, Table of n, a(n) for n = 1..300
MAPLE
a:= proc(n) option remember;
local ok, m, k;
if n<3 then 3*n-2
else for m from a(n-1)+1 do
ok:= true;
for k from 1 to n-1 do
if igcd(n, k)=1 xor igcd(m, a(k))=1
then ok:= false; break fi
od;
if ok then break fi
od; m
fi
end:
seq (a(n), n=1..50); # Alois P. Heinz, Nov 21 2010
MATHEMATICA
t={1, 4}; Do[nxt=t[[-1]]+1; While[CoprimeQ[n, Range[n-1]] != CoprimeQ[nxt, t], nxt++]; AppendTo[t, nxt], {n, 3, 50}]; t
CROSSREFS
KEYWORD
nonn
AUTHOR
Vladimir Shevelev, Nov 21 2010
EXTENSIONS
More terms from Alois P. Heinz, Nov 21 2010
STATUS
approved