OFFSET
0,12
LINKS
FORMULA
T(n, n) = A343255(n).
T(n, 0) = A345021(n).
T(n, 1) = A000120(n).
T(n, 2) = n.
T(n, 3) = A222112(n-1).
T(0, k) = 0.
T(1, k) = 1.
T(2, k) = k.
T(3, k) = k + 1.
T(4, k) = k^k = A000312(k).
T(5, k) = k^k + 1 = A014566(k).
T(6, k) = k^k + k = A066068(k).
T(7, k) = k^k + k + 1 = A066279(k).
T(16, k) = k^k^k = A002488(k).
T(m + n, k) = T(m, k) + T(n, k) when m AND n = 0 (where AND denotes the bitwise AND operator).
EXAMPLE
Array T(n, k) begins:
n\k| 0 1 2 3 4 5 6 7 8 9
---+-------------------------------------------------------------------
0| 0 0 0 0 0 0 0 0 0 0
1| 1 1 1 1 1 1 1 1 1 1
2| 0 1 2 3 4 5 6 7 8 9
3| 1 2 3 4 5 6 7 8 9 10
4| 1 1 4 27 256 3125 46656 823543 16777216 387420489
5| 2 2 5 28 257 3126 46657 823544 16777217 387420490
6| 1 2 6 30 260 3130 46662 823550 16777224 387420498
7| 2 3 7 31 261 3131 46663 823551 16777225 387420499
8| 0 1 8 81 1024 15625 279936 5764801 134217728 3486784401
9| 1 2 9 82 1025 15626 279937 5764802 134217729 3486784402
10| 0 2 10 84 1028 15630 279942 5764808 134217736 3486784410
PROG
(PARI) T(n, k) = { my (v=0, e); while (n, n-=2^e=valuation(n, 2); v+=k^T(e, k)); v }
CROSSREFS
KEYWORD
AUTHOR
Rémy Sigrist, Jun 04 2021
STATUS
approved