login
Number A(n,k) of set partitions of [n] such that the difference between each element and its index (in the partition) is a multiple of k; square array A(n,k), n>=0, k>=0, read by antidiagonals.
10

%I #11 Feb 02 2017 09:32:31

%S 1,1,1,1,1,2,1,1,2,4,1,1,2,5,8,1,1,2,4,15,16,1,1,2,4,8,52,32,1,1,2,4,

%T 8,18,203,64,1,1,2,4,8,16,40,877,128,1,1,2,4,8,16,32,101,4140,256,1,1,

%U 2,4,8,16,32,68,254,21147,512,1,1,2,4,8,16,32,64,144,723,115975,1024

%N Number A(n,k) of set partitions of [n] such that the difference between each element and its index (in the partition) is a multiple of k; square array A(n,k), n>=0, k>=0, read by antidiagonals.

%H Alois P. Heinz, <a href="/A274859/b274859.txt">Antidiagonals n = 0..34, flattened</a>

%e Square array A(n,k) begins:

%e : 1, 1, 1, 1, 1, 1, 1, ...

%e : 1, 1, 1, 1, 1, 1, 1, ...

%e : 2, 2, 2, 2, 2, 2, 2, ...

%e : 4, 5, 4, 4, 4, 4, 4, ...

%e : 8, 15, 8, 8, 8, 8, 8, ...

%e : 16, 52, 18, 16, 16, 16, 16, ...

%e : 32, 203, 40, 32, 32, 32, 32, ...

%e : 64, 877, 101, 68, 64, 64, 64, ...

%e : 128, 4140, 254, 144, 128, 128, 128, ...

%e : 256, 21147, 723, 304, 264, 256, 256, ...

%e : 512, 115975, 2064, 692, 544, 512, 512, ...

%p b:= proc(l, k, i, t) option remember; `if`(l=[], 1, add(`if`(l[j]=t,

%p b(subsop(j=[][], l), k, j, irem(1+t, k)), 0), j=[1, $i..nops(l)]))

%p end:

%p A:= (n, k)-> `if`(n=0, 1, `if`(k=0, 2^(n-1), b([seq(

%p irem(i, k), i=2..n)], k, 1, irem(2, k)))):

%p seq(seq(A(n, d-n), n=0..d), d=0..15);

%t b[l_, k_, i_, t_] := b[l, k, i, t] = If[l == {}, 1, Sum[If[l[[j]] == t, b[ReplacePart[l, j -> Nothing], k, j, Mod[1+t, k]], 0], {j, Prepend[ Range[i, Length[l]], 1]}]]; A[n_, k_] := If[n==0, 1, If[k==0, 2^(n-1), b[Flatten[Table[Mod[i, k], {i, 2, n}]], k, 1, Mod[2, k]]]]; Table[A[n, d - n], {d, 0, 15}, {n, 0, d}] // Flatten (* _Jean-François Alcover_, Feb 02 2017, translated from Maple *)

%Y Columns k=0-10 give: A011782, A000110, A274547, A274860, A274861, A274862, A274863, A274864, A274865, A274866, A274867.

%K nonn,tabl

%O 0,6

%A _Alois P. Heinz_, Jul 09 2016