OFFSET
0,2
COMMENTS
Because of the interchangeability of 0 and 1 in the definition, A(n, k) is even if n, k >= 1. In other words, if the binary representation of a permutation of the defined type is counted, then so is the 1's complement of that representation.
FORMULA
A(n, k) = Sum_{j=0..k} binomial(n*k, n*j).
T(n, k) = Sum_{j=0..n-k} binomial((n - k)*k, j*k).
EXAMPLE
Array A(n, k) starts:
[0] 1, 2, 3, 4, 5, 6, 7, ... A000027
[1] 1, 2, 4, 8, 16, 32, 64, ... A000079
[2] 1, 2, 8, 32, 128, 512, 2048, ... A081294
[3] 1, 2, 22, 170, 1366, 10922, 87382, ... A007613
[4] 1, 2, 72, 992, 16512, 261632, 4196352, ... A070775
[5] 1, 2, 254, 6008, 215766, 6643782, 215492564, ... A070782
[6] 1, 2, 926, 37130, 2973350, 174174002, 11582386286, ... A070967
[7] 1, 2, 3434, 232562, 42484682, 4653367842, 644032289258, ... A094211
.
Triangle T(n, k) starts:
[0] 1;
[1] 2, 1;
[2] 3, 2, 1;
[3] 4, 4, 2, 1;
[4] 5, 8, 8, 2, 1;
[5] 6, 16, 32, 22, 2, 1;
[6] 7, 32, 128, 170, 72, 2, 1;
[7] 8, 64, 512, 1366, 992, 254, 2, 1;
[8] 9, 128, 2048, 10922, 16512, 6008, 926, 2, 1;
[9] 10, 256, 8192, 87382, 261632, 215766, 37130, 3434, 2, 1;
.
A(2, 2) = 8 = card(0000, 1100, 1010, 1001, 0110, 0101, 0011, 1111).
A(1, 3) = 8 = card(000, 100, 010, 001, 110, 101, 011, 111).
MAPLE
T := (n, k) -> add(binomial((n - k)*k, j*k), j = 0 .. n-k):
seq(print(seq(T(n, k), k = 0..n)), n = 0..7);
PROG
(SageMath) # In Python use this import:
# from sympy.utilities.iterables import multiset_permutations
def A(n: int, k: int) -> int:
if n == 0: return k + 1
count = 0
for a in range(0, n * k + 1, n):
S = [i < a for i in range(n * k)]
count += Permutations(S).cardinality()
return count
def ARow(n: int, size: int) -> list[int]:
return [A(n, k) for k in range(size)]
for n in range(6): print(ARow(n, 5))
CROSSREFS
KEYWORD
nonn,tabl
AUTHOR
Peter Luschny, Mar 18 2023
STATUS
approved