I have a polynomial in falling factorial form, i. e. $-x+7(-1+x)x+6(-2+x)(-1+x)x+(-3+x)(-2+x)(-1+x)x$.
Now i want to extract the "outermost" coefficients $\{-1,7,6,1\}$. I have this code to get all the digits next to a left bracket:
numbersNextToLeftBracket = Cases[fallingFactorialForm, a_?(NumberQ) (b_) :> a, {1}]
However, this only gives me $\{-1,7,6\}$ because the last $1$ is not visible. How can I rewrite this so it includes all these coefficients?
FullForm[fallingFactorialForm]
, for theCases
pattern, tryt :(Times[coef_Integer, __] | Times[coef_Plus, __]) :> If[IntegerQ[coef], coef, 1]
$\endgroup$