OFFSET
1,2
LINKS
G. C. Greubel, Table of n, a(n) for n = 1..1000
MATHEMATICA
a = {1}; Do[If[GCD[n, a[[ -1]]] == 1, k = a[[ -1]] + 1; While[GCD[k, n] > 1, k++ ]; AppendTo[a, k], k = a[[ -1]] + 1; While[GCD[k, n] < 2, k++ ]; AppendTo[a, k]], {n, 2, 100}]; a (* Stefan Steinerberger, Aug 05 2009 *)
PROG
(PARI) al(n)=local(v, q); v=vector(n); v[1]=1; for(k=2, n, q=gcd(k, v[k-1])!=1; v[k]=v[k-1]+1; while(gcd(k, v[k])!=1!=q, v[k]++)); v \\ Franklin T. Adams-Watters, Aug 06 2009
CROSSREFS
KEYWORD
nonn
AUTHOR
Leroy Quet, Jul 28 2009
EXTENSIONS
More terms from Stefan Steinerberger and Franklin T. Adams-Watters, Aug 05 2009
STATUS
approved