OFFSET
0,3
COMMENTS
In other words, T(n,k) is the number of binary strings of length n without maximal runs of ones of length < k.
LINKS
Andrew Howroyd, Table of n, a(n) for n = 0..1325 (first 51 antidiagonals)
R. K. Guy, Anyone for Twopins?, in D. A. Klarner, editor, The Mathematical Gardner. Prindle, Weber and Schmidt, Boston, 1981, pp. 2-15. [Annotated scanned copy, with permission]
FORMULA
T(n,k) = Sum_{i=0..floor((n+1)/(k+1))} binomial(n+1-(k-1)*i,2*i).
G.f. of column k: (1 - x + x^k)/(1 - 2*x + x^2 - x^(k+1)).
EXAMPLE
Array begins:
=================================
n\k | 1 2 3 4 5 6 7 8 9
----+----------------------------
0 | 1 1 1 1 1 1 1 1 1 ...
1 | 2 1 1 1 1 1 1 1 1 ...
2 | 4 2 1 1 1 1 1 1 1 ...
3 | 8 4 2 1 1 1 1 1 1 ...
4 | 16 7 4 2 1 1 1 1 1 ...
5 | 32 12 7 4 2 1 1 1 1 ...
6 | 64 21 11 7 4 2 1 1 1 ...
7 | 128 37 17 11 7 4 2 1 1 ...
8 | 256 65 27 16 11 7 4 2 1 ...
...
PROG
(PARI) T(n, k) = polcoef((1 - x + x^k)/(1 - 2*x + x^2 - x^(k+1)) + O(x*x^n), n)
(Python)
from sympy import Matrix
from math import isqrt, comb
def A388146_T(n, k):
if k == 1: return 1<<n
A = Matrix([[2, -1]+[0]*(k-2)+[1]]+[[0]*i+[1]+[0]*(k-i) for i in range(k)])
return (A**(n-k+1)*Matrix([1]*(k+1)))[0]
def A388146(n):
a = (m:=isqrt(k:=n+1<<1))+(k>m*(m+1))
x = n-comb(a, 2)
return A388146_T(x, a-x) # Chai Wah Wu, Jun 11 2026
CROSSREFS
KEYWORD
nonn,tabl
AUTHOR
Andrew Howroyd, Sep 15 2025
STATUS
approved
