

A075626


a(1) = 1, then group the natural numbers so that the nth group contains n numbers relatively prime to n whose sum is divisible by n: (1), (3, 5), (2, 8, 11), (7, 9, 13, 15), (4, 6, 12, 14, 19), (17, 23, 25, 29, 31, 37), ...


4



1, 3, 5, 2, 8, 11, 7, 9, 13, 15, 4, 6, 12, 14, 19, 17, 23, 25, 29, 31, 37, 10, 16, 18, 20, 22, 24, 30, 21, 27, 33, 35, 39, 41, 43, 49, 26, 28, 32, 34, 38, 40, 44, 47, 53, 51, 57, 59, 61, 63, 67, 69, 71, 73, 79, 36, 42, 45, 46, 48, 50, 52, 54, 56, 58, 74, 55, 65, 77, 83, 85, 89
(list;
table;
graph;
refs;
listen;
history;
text;
internal format)



OFFSET

1,2


LINKS

Table of n, a(n) for n=1..72.


EXAMPLE

1; 3,5; 2,8,11; 7,9,13,15; 4,6,12,14,19; 17,23,25,29,31,37; ...
T(3, 2) is 8 because if it were 4 or 7, we could not add a number relatively prime to 3 and get a sum divisible by 3.


PROG

(PARI) print1(1, " "); used = vector(10000); used[1] = 1; x = 2; for (n = 2, 15, i = x; s = 0; for (k = 1, n  2, while (used[i]  gcd(i, n) > 1, i++); print1(i, " "); used[i] = 1; s += i; i++); while (used[i]  gcd(i, n) > 1  gcd(i + s, n) > 1, i++); print1(i, " "); used[i] = 1; s += i; i += (n  (i + s)%n); while (used[i], i += n); print1(i, " "); used[i] = 1; while (used[x], x++)); (Wasserman)


CROSSREFS

Cf. A075627, A075628, A075629, A075630.
Sequence in context: A282348 A026193 A026143 * A152649 A327263 A186412
Adjacent sequences: A075623 A075624 A075625 * A075627 A075628 A075629


KEYWORD

nonn,tabl


AUTHOR

Amarnath Murthy, Sep 30 2002


EXTENSIONS

More terms from David Wasserman, Jan 22 2005


STATUS

approved



