# Definition of a function depending on a sequence

let $a_{n}$ is a given fixed sequence, say $a_{n}:=1/n$. I would like to define something like $$D_{j}:=\sum_{k=1}^{j}\frac{1}{j!}BellY[j,k,\{a_1,a_2,\dots,a_{j-k+1}\}].$$ Function BellY is implemented in Mathematica.

The problem is the variable number of inputs in BellY. How one can do that in Mathematica? Many thanks!

• welcome to MSE. There are a number of ways to do things in Mathematica. This site strongly encourages your own attempts (as this is the best way to learn). "Please code..." requests and similar is not looked on favourably. You have the raw materials and a built-in function, so dive in and have fun from now on. Here is one way to get you started: a[j_] := 1/j; d[j_] := With[{tab = a /@ Range[j], c = j!}, Total[BellY @@ {j, j - # + 1, tab[[1 ;; #]]} & /@ Range[j, 1, -1]]/ c]. – ubpdqn Sep 27 '15 at 10:54

Dj = Sum[1/Factorial[j] * BellY[j,k,q],{k,1,j}]