OFFSET
0,3
FORMULA
a(n) = Sum_{k=0..A003056(n)} (-1)^k * q(n,k) * 3^(n-k), where q(n,k) is the number of partitions of n into k distinct parts.
MATHEMATICA
nmax = 30; CoefficientList[Series[Product[(1 - 3^(k - 1) x^k), {k, 1, nmax}], {x, 0, nmax}], x]
Table[Sum[(-1)^k Length[Select[IntegerPartitions[n, {k}], UnsameQ @@ # &]] 3^(n - k), {k, 0, Floor[(Sqrt[8 n + 1] - 1)/2]}], {n, 0, 30}]
CROSSREFS
KEYWORD
sign
AUTHOR
Ilya Gutkovskiy, Jun 08 2022
STATUS
approved