A379636 Triangle read by rows: T(n,k) (n >= k) is the maximum number of black cells in a n X k grid such that no black cell is edge-adjacent to more than one black cell.
1, 2, 2, 2, 4, 5, 3, 4, 7, 8, 4, 6, 9, 11, 14, 4, 6, 10, 12, 16, 18, 5, 8, 12, 15, 19, 22, 26, 6, 8, 14, 16, 22, 24, 30, 32, 6, 10, 15, 19, 24, 28, 33, 38, 42, 7, 10, 17, 20, 27, 30, 37, 40, 47, 50, 8, 12, 19, 23, 30, 34, 41, 46, 52, 57, 63, 8, 12, 20, 24, 32
Offset: 1
Examples
The triangle begins: n\k [1] [2] [3] [4] [5] [6] [7] [1] 1; [2] 2, 2; [3] 2, 4, 5; [4] 3, 4, 7, 8; [5] 4, 6, 9, 11, 14; [6] 4, 6, 10, 12, 16, 18; [7] 5, 8, 12, 15, 19, 22, 26; ... T(8,1) = 6: XX_XX_XX T(7,7) = 26: XX_X_XX __X_X__ XX_X_XX --X_X__ XX_X_XX __X_X__ XX_X_XX
Links
- Yifan Xie, Rows 1..100 of triangle, flattened
Crossrefs
Cf. A260090 (where adjacency is defined by having a common vertex)
Programs
-
PARI
T(n,k)=if(n%2==0 && k%2==0, n*k/2, if(n%2==0, n*(k-1)/2+ceil(2*n/3), if(k%2==0, k*(n-1)/2+ceil(2*k/3), n*(k-1)/2+ceil(2*n/3))));
Formula
If n and k are both even, T(n,k) = n*k/2;
If n is even and k is odd, T(n,k) = n*(k-1)/2 + ceiling(2*n/3);
If n is odd and k is even, T(n,k) = k*(n-1)/2 + ceil(2*k/3);
If n and k are both odd, T(n,k) = n*(k-1)/2 + ceiling(2*n/3).
Comments