OFFSET

1,2

COMMENTS

Obviously all members of the n-th group are coprime to n.

EXAMPLE

1

3 5

2 4 7

9 11 13 17

6 8 12 14 16

...

PROG

(PARI) used = vector(1000); print(1); for (n = 2, 15, rowProd = 1; x = 2; for (k = 1, n - 1, while (used[x] || gcd(x, n) > 1, x = x + 1); print1(x); print1(" "); used[x] = 1; rowProd = rowProd*x; x = x + 1); while (used[x] || rowProd*x%n != n - 1, x = x + 1); print(x); used[x] = 1);

CROSSREFS

KEYWORD

nonn,tabl

AUTHOR

Amarnath Murthy, Apr 22 2003

EXTENSIONS

More terms from David Wasserman, Oct 05 2004

STATUS

approved