OFFSET
0,15
LINKS
Pontus von Brömssen, Antidiagonals n = 0..99, flattened
M. J. Bannister, Z. Cheng, W. E. Devanny, and D. Eppstein, Superpatterns and universal point sets, Journal of Graph Algorithms and Applications 18(2) (2014), 177-209.
FORMULA
T(n,k) = floor(n/k) + k*T(floor(n/k),k). Proof: With n = Sum_{j>=0} d_j*k^j we have floor(n/k) + k*T(floor(n/k),k) = Sum_{j>=1} (d_j*k^(j-1) + k*d_j*(j-1)*k^(j-2)) = Sum_{j>=1} d_j*j*k^(j-1) = T(n,k).
T(n,k) = T(n-1,k) + A055129(A286561(n,k),k). Proof: Let n = Sum_{j>=0} d_j*k^j and pick v so that d_j = 0 for j < v and d_v > 0 (so v = A286561(n,k)). Then n - 1 = sum_{j>=0} e_j*k^j, where e_j = k - 1 for j < v, e_v = d_v - 1, and e_j = d_j for j > v. We get T(n,k) - T(n-1,k) = Sum_{j>=1} j*(d_j-e_j)*k^(j-1) = v*k^(v-1) - (k-1)*Sum_{1<=j<v} j*k^(j-1). Working out the sum and simplifying, we get T(n,k) - T(n-1,k) = (k^v - 1)/(k - 1) = A055129(A286561(n,k),k).
For fixed k, T(n,k) ~ n*log(n)/(k*log(k)). (The proof for k = 2 by Bannister et al. (p. 182) can be adapted to general k.)
T(n,k) = Sum_{j>=0} k^j*floor(n/k**(j+1)).
EXAMPLE
Array begins:
n\k| 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
---|---------------------------------------------
0 | 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
1 | 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
2 | 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0
3 | 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0
4 | 4 1 1 0 0 0 0 0 0 0 0 0 0 0 0
5 | 4 1 1 1 0 0 0 0 0 0 0 0 0 0 0
6 | 5 2 1 1 1 0 0 0 0 0 0 0 0 0 0
7 | 5 2 1 1 1 1 0 0 0 0 0 0 0 0 0
8 | 12 2 2 1 1 1 1 0 0 0 0 0 0 0 0
9 | 12 6 2 1 1 1 1 1 0 0 0 0 0 0 0
10 | 13 6 2 2 1 1 1 1 1 0 0 0 0 0 0
11 | 13 6 2 2 1 1 1 1 1 1 0 0 0 0 0
12 | 16 7 3 2 2 1 1 1 1 1 1 0 0 0 0
13 | 16 7 3 2 2 1 1 1 1 1 1 1 0 0 0
14 | 17 7 3 2 2 2 1 1 1 1 1 1 1 0 0
15 | 17 8 3 3 2 2 1 1 1 1 1 1 1 1 0
16 | 32 8 8 3 2 2 2 1 1 1 1 1 1 1 1
64 = 2*3^3 + 1*3^2 + 0*3^1 + 1*3^0, so T(64,3) = 2*3*3^2 + 1*2*3^1 + 0*1*3^0 = 60. Alternatively, using the formula T(n,k) = floor(n/k) + k*T(floor(n/k),k), we get T(64,3) = 21 + 3*T(21,3) = 21 + 3*(7 + 3*T(7,3)) = 42 + 9*(2 + 3*T(2,3)) = 60.
PROG
CROSSREFS
KEYWORD
AUTHOR
Pontus von Brömssen, Sep 04 2020
STATUS
approved