Reminder: The OEIS is hiring a new managing editor, and the application deadline is January 26.
%I #13 Sep 23 2023 03:10:58
%S 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,
%T 24,30,21,27,33,35,39,41,43,49,26,28,32,34,38,40,44,47,53,51,57,59,61,
%U 63,67,69,71,73,79,36,42,45,46,48,50,52,54,56,58,74,55,65,77,83,85,89
%N a(1) = 1, then group the natural numbers so that the n-th group contains n numbers relatively prime to n whose sum is divisible by n.
%e Triangle begins:
%e 1;
%e 3, 5;
%e 2, 8, 11;
%e 7, 9, 13, 15;
%e 4, 6, 12, 14, 19;
%e 17, 23, 25, 29, 31, 37;
%e ...
%e 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.
%o (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++)); \\ _David Wasserman_, Jan 22 2005
%Y Cf. A075627, A075628, A075629, A075630.
%K nonn,tabl
%O 1,2
%A _Amarnath Murthy_, Sep 30 2002
%E More terms from _David Wasserman_, Jan 22 2005