OFFSET
1,2
COMMENTS
Array is read by descending antidiagonals with (n,k) = (1,1), (1,2), (2,1), (1,3), (2,2), (3,1), etc.
EXAMPLE
The top left 15x16 corner of the array:
n\k | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
-----+---------------------------------------------------------------------
1 | 1, 2, 3, 4, 5, 7, 8, 9, 11, 13, 16, 17, 19, 23, 25,
2 | 3, 5, 7, 9, 11, 13, 17, 19, 23, 25, 27, 29, 31, 37, 41,
3 | 4, 7, 13, 16, 19, 25, 31, 37, 43, 49, 61, 64, 67, 73, 79,
4 | 5, 9, 13, 17, 21, 25, 29, 37, 41, 49, 53, 57, 61, 73, 81,
5 | 3, 6, 8, 11, 13, 16, 23, 26, 31, 36, 41, 43, 46, 51, 53,
6 | 7, 13, 19, 25, 31, 37, 43, 49, 61, 67, 73, 79, 97, 103, 109,
7 | 4, 5, 8, 11, 15, 19, 22, 25, 29, 32, 39, 43, 47, 50, 53,
8 | 3, 9, 11, 17, 19, 25, 27, 33, 41, 43, 49, 57, 59, 67, 73,
9 | 5, 7, 10, 14, 16, 19, 23, 25, 28, 32, 37, 41, 43, 46, 50,
10 | 11, 31, 41, 51, 61, 71, 81, 91, 101, 121, 131, 141, 151, 171, 181,
11 | 3, 4, 6, 9, 12, 15, 17, 23, 25, 28, 31, 34, 37, 45, 47,
12 | 13, 25, 37, 49, 61, 73, 85, 97, 109, 121, 145, 157, 169, 181, 193,
13 | 7, 8, 9, 11, 14, 20, 22, 23, 27, 33, 37, 40, 46, 47, 48,
14 | 5, 15, 19, 29, 43, 47, 57, 61, 71, 89, 99, 103, 113, 127, 131,
15 | 4, 8, 16, 19, 23, 31, 38, 46, 49, 53, 61, 64, 76, 79, 83,
16 | 7, 11, 13, 17, 23, 27, 29, 33, 43, 49, 59, 61, 65, 71, 75,
PROG
(PARI)
up_to = 105;
A345992(n) = for(m=1, oo, if((m*(m+1))%n==0, return(gcd(n, m))));
memoA354930sq = Map();
A354930sq(n, k) = { my(v=0); if(!mapisdefined(memoA354930sq, [n, k-1], &v), if(1==k, v=0, v = A354930sq(n, k-1))); for(i=1+v, oo, if(A345992(i)==n, mapput(memoA354930sq, [n, k], i); return(i))); };
A354940sq(n, k) = (A354930sq(n, k)/n);
A354940list(up_to) = { my(v = vector(up_to), i=0); for(a=1, oo, for(col=1, a, i++; if(i > up_to, return(v)); v[i] = A354940sq(col, (a-(col-1))))); (v); };
v354940 = A354940list(up_to);
A354940(n) = v354940[n];
CROSSREFS
KEYWORD
nonn,tabl
AUTHOR
Antti Karttunen, Jun 15 2022
STATUS
approved