OFFSET
2,1
EXAMPLE
The array starts as follows:
5, 9, 13, 17, 21, 25, 29, 33, 37, 41, 45
8, 10, 17, 19, 26, 28, 35, 37, 44, 46, 53
17, 33, 49, 65, 81, 97, 113, 129, 145, 161, 177
7, 18, 24, 26, 32, 43, 49, 51, 57, 68, 74
37, 73, 109, 145, 181, 217, 253, 289, 325, 361, 397
18, 19, 30, 31, 48, 50, 67, 68, 79, 80, 97
65, 129, 193, 257, 321, 385, 449, 513, 577, 641, 705
80, 82, 161, 163, 242, 244, 323, 325, 404, 406, 485
101, 201, 301, 401, 501, 601, 701, 801, 901, 1001, 1101
3, 9, 27, 40, 81, 94, 112, 118, 120, 122, 124
145, 289, 433, 577, 721, 865, 1009, 1153, 1297, 1441, 1585
PROG
(PARI) row(n, terms) = my(i=0); for(b=2, oo, if(i>=terms, print(""); break, if(Mod(b, n^2)^(n-1)==1, print1(b, ", "); i++)))
array(rows, cols) = for(x=2, rows+1, row(x, cols))
array(6, 5) \\ Print initial 6 rows and 5 columns of array
(Python)
def T(n, k):
j, n2, c = 2, n*n, 0
while c != k:
if pow(j, n-1, n2) == 1: c += 1
j += 1
return j-1
def auptodiag(maxd):
return [T(d+2-j, j) for d in range(1, maxd+1) for j in range(d, 0, -1)]
print(auptodiag(11)) # Michael S. Branicky, Apr 29 2022
CROSSREFS
KEYWORD
nonn,tabl
AUTHOR
Felix Fröhlich, Apr 29 2022
STATUS
approved