A378126 Array read by antidiagonals: T(n, m) is the maximal size of partitions of (n, m) into sums of distinct pairs of nonnegative integers, excluding (0, 0).
0, 1, 1, 1, 2, 1, 2, 2, 2, 2, 2, 3, 3, 3, 2, 2, 3, 3, 3, 3, 2, 3, 3, 4, 4, 4, 3, 3, 3, 4, 4, 4, 4, 4, 4, 3, 3, 4, 4, 4, 5, 4, 4, 4, 3, 3, 4, 5, 5, 5, 5, 5, 5, 4, 3, 4, 4, 5, 5, 5, 5, 5, 5, 5, 4, 4, 4, 5, 5, 5, 6, 6, 6, 6, 5, 5, 5, 4, 4, 5, 5, 6, 6, 6, 6
Offset: 0
Examples
Table begins: 0 1 1 2 2 2 3 3 3 3 ... 1 2 2 3 3 3 4 4 4 4 ... 1 2 3 3 4 4 4 5 5 5 ... 2 3 3 4 4 4 5 5 5 6 ... 2 3 4 4 5 5 5 6 6 6 ... 2 3 4 4 5 5 6 6 6 7 ... 3 4 4 5 5 6 6 6 7 7 ... 3 4 5 5 6 6 6 7 7 7 ... 3 4 5 5 6 6 7 7 7 8 ... 3 4 5 6 6 7 7 7 8 8 ... ... T(9, 5) = 7, as (9, 5) can be expressed as the sum (0, 1) + (0, 2) + (1, 0) + (1, 1) + (2, 0) + (2, 1) + (3, 0), which is the longest for (9, 5).
Links
- Jimin Park, Table of n, a(n) for n = 0..1000
Crossrefs
Programs
-
Python
import functools @functools.cache def A378126(n: int, m: int, t: tuple[int, int] = (0, 0)) -> int: if (n, m) <= t: return 0 v = 1 for nn in range(t[0], n//2+1): for nm in range(m+1): if (nn, nm) <= t: continue rn, rm = n-nn, m-nm if (rn, rm) <= (nn, nm): continue nv = 1 + A378126(rn, rm, (nn, nm)) if nv > v: v = nv return v
Comments