OFFSET
2,3
COMMENTS
The rows converge to the lower left part of the usual multiplication table A003991 (without zeros), (1; 2, 4; 3, 6, 9; 4, 8, 12, 16; ...).
Length of row n is n(n-1)/2.
Row n has a zero iff n is a composite number.
Row n starts with a(n(n-1)(n-2)/6+2) = 1 and ends with (n-1, n-2, ..., 1).
EXAMPLE
For n = 2, the multiplication table (mod 2) is
x | 0 | 1 |
---+---+---+
0 | 0 | 0 |
1 | 0 | 1 |
Since the first row and column is always zero, we keep only the 1 X 1 table [1], which is the fist element of the sequence.
For n = 3, the reduced multiplication table (mod 3), without row / column 0, is:
x | 1 | 2 |
---+---+---+
1 | 1 | 2 |
2 | 2 | 1 | since 2 * 2 = 4 == 1 (mod 3)
The lower left triangle of the values is [ 1 ; 2, 1 ], which are the next terms (row 2) of the sequence.
For n = 4, we have
x | 1 | 2 | 3 |
---+---+---+---|
1 | 1 | 2 | 3 |
2 | 2 | 0 | 2 | since 2 * 2 == 0 (mod 4), 2 * 3 == 2 (mod 4).
3 | 3 | 2 | 1 | since 3 * 3 == 1 (mod 4).
Therefore, row 4 is [ 1 ; 2, 0 ; 3, 2, 1 ].
For n = 5, we have
x | 1 | 2 | 3 | 4 |
---+---+---+---+---|
1 | 1 | ... |
2 | 2 | 4 | ... |
3 | 3 | 1 | 4 |...| since 3*2 == 1 (mod 5), 3*3 == 4 (mod 5).
4 | 4 | 3 | 2 | 1 | since 3 * 3 == 1 (mod 4).
Therefore, row 4 is [ 1 ; 2, 4 ; 3, 1, 4 ; 4, 3, 2, 1 ].
PROG
(PARI) A390838_row(n)=concat([r*[1..r] | r <- [1..n-1]])%n
CROSSREFS
KEYWORD
nonn,base
AUTHOR
M. F. Hasler, Jan 17 2026
STATUS
approved
