OFFSET
2,6
COMMENTS
The expansion of A(n, k) in base n is:
q n-1 ... n-1
<- p times ->
where q = k mod (n-1) and p = floor(k / (n-1)).
LINKS
Andrew Howroyd, Table of n, a(n) for n = 2..1276 (first 50 antidiagonals)
FORMULA
A(2, k) = 2^k - 1.
A(3, k) = A062318(k+1).
A(4, k) = A180516(k+1).
A(5, k) = A181287(k+1).
A(6, k) = A181288(k+1).
A(7, k) = A181303(k+1).
A(8, k) = A165804(k+1).
A(9, k) = A140576(k+1).
A(10, k) = A051885(k).
A(n, 0) = 0.
A(n, 1) = 1.
A(n, k) = k iff k < n.
A(n, n) = 2*n - 1.
A(n, n+1) = 3*n - 1 for any n > 2.
EXAMPLE
Array A(n, k) begins:
n\k| 0 1 2 3 4 5 6 7 8 9 10 11 12
---+---------------------------------------------------------
2| 0 1 3 7 15 31 63 127 255 511 1023 2047 4095
3| 0 1 2 5 8 17 26 53 80 161 242 485 728
4| 0 1 2 3 7 11 15 31 47 63 127 191 255
5| 0 1 2 3 4 9 14 19 24 49 74 99 124
6| 0 1 2 3 4 5 11 17 23 29 35 71 107
7| 0 1 2 3 4 5 6 13 20 27 34 41 48
8| 0 1 2 3 4 5 6 7 15 23 31 39 47
9| 0 1 2 3 4 5 6 7 8 17 26 35 44
10| 0 1 2 3 4 5 6 7 8 9 19 29 39
Array A(n, k) begins (with values given in base n):
n\k| 0 1 2 3 4 5 6 7 8 9
---+------------------------------------------------------------------
2| 0 1 11 111 1111 11111 111111 1111111 11111111 111111111
3| 0 1 2 12 22 122 222 1222 2222 12222
4| 0 1 2 3 13 23 33 133 233 333
5| 0 1 2 3 4 14 24 34 44 144
6| 0 1 2 3 4 5 15 25 35 45
7| 0 1 2 3 4 5 6 16 26 36
8| 0 1 2 3 4 5 6 7 17 27
9| 0 1 2 3 4 5 6 7 8 18
10| 0 1 2 3 4 5 6 7 8 9
PROG
(PARI) A(n, k) = { (1+k%(n-1))*n^(k\(n-1))-1 }
(Python) def A(n, k): return (1+(k % (n-1)))*n**(k//(n-1))-1
CROSSREFS
KEYWORD
AUTHOR
Rémy Sigrist, Aug 10 2022
STATUS
approved