Stirling Transform

Author

Eric W. Weisstein
July 2, 2003

This notebook downloaded from http://mathworld.wolfram.com/notebooks/IntegerSequences/StirlingTransform.nb.

For more information, see Eric's MathWorld entry http://mathworld.wolfram.com/StirlingTransform.html.

©2005 Wolfram Research, Inc. except for portions noted otherwise

Code

StirlingTransform[a_List]:=Module[{n,k},Table[Sum[StirlingS2[n,k]a[[k+1]],{k,0,n}],{n,0,Length[a]-1}]]

InverseStirlingTransform[b_List]:=Module[{n,k},Table[Sum[StirlingS1[n,k]b[[k+1]],{k,0,n}],{n,0,Length[b]-1}]]

StirlingTransform::usage="StirlingTransform[{a1,a2,...}] gives the Stirling transform {b1,b2,...} of the given sequence.";

InverseStirlingTransform::usage="InverseStirlingTransform[{b1,b2,...}] gives the inverse Stirling transform {a1,a2,...} of the given sequence.";

Examples

1

Bell (or Exponential) Numbers , M1484

StirlingTransform[Table[1,{10}]]

InverseStirlingTransform[%]

k

StirlingTransform[Range[0,10]]

InverseStirlingTransform[%]

CoefficientList[Series[Exp[Exp[x]+2x-1],{x,0,10}],x]Table[n!,{n,0,10}]

k+1

M2851

StirlingTransform[Range[10]]

InverseStirlingTransform[%]

Primes

p[n_Integer?PrimeQ]:=1
p[n_Integer]:=0

StirlingTransform[Table[p[n],{n,0,10}]]

InverseStirlingTransform[%]

Even/odd

q[n_Integer?EvenQ]:=1
q[n_Integer?OddQ]:=0

StirlingTransform[Table[q[n],{n,0,10}]]

InverseStirlingTransform[%]

Odd/even

r[n_Integer?EvenQ]:=0
r[n_Integer?OddQ]:=1

StirlingTransform[Table[r[n],{n,0,10}]]

InverseStirlingTransform[%]

Factorial

StirlingTransform[Table[(-1)^n n!,{n,0,10}]]

InverseStirlingTransform[Range[10]]

Table[(-1)^n n!,{n,0,10}]