%I #9 May 15 2018 08:34:51
%S 1,1,1,1,1,1,1,1,2,3,4,5,6,7,8,17,34,65,120,215,374,629,1641,3919,
%T 8849,19241,40707,84203,170229,503902,1407019,3746718,9600121,
%U 23815820,57408783,134592586,440661179,1383544922,4206645985,12456581554,36012285385
%N Number of set partitions of [n] such that the difference between each element and its block index is a multiple of seven.
%H Alois P. Heinz, <a href="/A274840/b274840.txt">Table of n, a(n) for n = 0..874</a>
%H Wikipedia, <a href="https://en.wikipedia.org/wiki/Partition_of_a_set">Partition of a set</a>
%e a(8) = 2: 18|2|3|4|5|6|7, 1|2|3|4|5|6|7|8.
%e a(9) = 3: 18|29|3|4|5|6|7, 1|29|3|4|5|6|7|8, 1|2|3|4|5|6|7|8|9.
%e a(10) = 4: 18|29|3(10)|4|5|6|7, 1|29|3(10)|4|5|6|7|8, 1|2|3(10)|4|5|6|7|8|9, 1|2|3|4|5|6|7|8|9|(10).
%p b:= proc(n, m, t) option remember; `if`(n=0, 1,
%p add(`if`(irem(j-t, 7)=0, b(n-1, max(m, j),
%p irem(t+1, 7)), 0), j=1..m+1))
%p end:
%p a:= n-> b(n, 0, 1):
%p seq(a(n), n=0..42);
%t b[n_, m_, t_] := b[n, m, t] = If[n == 0, 1, Sum[If[Mod[j - t, 7] == 0, b[n - 1, Max[m, j], Mod[t + 1, 7]], 0], {j, 1, m + 1}]];
%t a[n_] := b[n, 0, 1];
%t Table[a[n], {n, 0, 42}] (* _Jean-François Alcover_, May 15 2018, after _Alois P. Heinz_ *)
%Y Column k=7 of A274835.
%K nonn
%O 0,9
%A _Alois P. Heinz_, Jul 08 2016
|