OFFSET
3,3
COMMENTS
Offset for n is 3, offset for d is 1, thus 1st entry is T(1,3).
FORMULA
T(d,n) = 2^n - prod_{1=0 to d-1} Tri(floor((n + i)/d) + 2) where Tri(n) is the n-th tribonacci number.
EXAMPLE
Table begins:
1, 3, 8, 20, 47, 107, 238, 520 ...
0, 0, 4, 15, 37, 87, 200, 448 ...
0, 0, 0, 0, 16, 60, 169, 387 ...
0, 0, 0, 0, 0, 0, 64, 240 ...
0, 0, 0, 0, 0, 0, 0, 0 ...
0, 0, 0, 0, 0, 0, 0, 0 ...
0, 0, 0, 0, 0, 0, 0, 0 ...
0, 0, 0, 0, 0, 0, 0, 0 ...
0, 0, 0, 0, 0, 0, 0, 0 ...
0, 0, 0, 0, 0, 0, 0, 0 ...
..................................
For T(2,5) we count subsets of {1,...,5} containing {1,3,5}, the only d=2 AP possible here. There are 4 subsets containing {1,3,5} so T(2,5) = 4.
MATHEMATICA
T[0]=0; T[1] = 1; T[2] = 1; T[n_] := T[n - 1] + T[n - 2] + T[n - 3]; a[d_, n_] := 2^n - Product[T[Floor[(n + i)/d] + 2], {i, 0, d - 1}]; Table[a[i, j], {i, 1, 10}, {j, 3, 10}]; Flatten[Table[a[j - i + 1, i + 3], {j, 0, 10}, {i, 0, j}]]
CROSSREFS
KEYWORD
nonn,tabl
AUTHOR
David Nacin, Mar 09 2012
STATUS
approved