OFFSET
1,2
COMMENTS
Rearrangement of natural numbers so that next n numbers are not coprime to n.
LINKS
Ivan Neretin, Rows n = 1..141, flattened
EXAMPLE
1
2 4
3 6 9
8 10 12 14
5 15 20 25 30
16 18 21 22 24 26
7 28 35 42 49 56 63
...
MATHEMATICA
Fold[Function[{a, n}, Join[a, Select[Complement[Range[Max[a] + n^2], a], GCD[n, #] > 1 &, n]]], {1}, Range[2, 12]] (* Ivan Neretin, Jun 05 2015 *)
PROG
(PARI) S=Set(); for(n=2, 20, k=0; m=1; while(k<n, m++; if(!setsearch(S, m)&&gcd(m, n)>1, S=setunion(S, [m]); print1(" ", m); k++))) (Alekseyev)
CROSSREFS
KEYWORD
nonn,tabl
AUTHOR
Amarnath Murthy, Jun 01 2004
EXTENSIONS
More terms from Max Alekseyev, Jun 30 2005
STATUS
approved