Suppose I know the sequence is of the $a n^4 + b n^3 + c n^2 + d n$, with positive integers $a,b,c,d$, what is the easiest way to get them from the first few coefficients?
Here are the sequences I'm looking at. Mathematica's FindSequenceFunction
works for the first one, but not for the rest
{15,48,105,192,315}
{15, 64, 183, 432, 895}
{15,80,273,720,1595}
{15, 144, 603, 1728, 3975}
Obtained from moments of Gaussian matrix products like $\operatorname{Tr}(AAAA^TA^TA^T)$ (background)
Clear[a, A, n];
getMoment[n_, expr_] := (
traceExpr = Tr[expr] /. A -> Array[a, {n, n}];
distSpec = # \[Distributed] NormalDistribution[0, 1] & /@
Variables[traceExpr];
Expectation[traceExpr, distSpec]
);
exprs = {A . A . A . A . A . A,
A\[Transpose] . A\[Transpose] . A . A\[Transpose] . A . A,
A . A . A . A\[Transpose] . A\[Transpose] . A\[Transpose],
A . A\[Transpose] . A . A\[Transpose] . A . A\[Transpose]};
getMomentSequence[expr_] := Table[getMoment[n, expr], {n, 1, 5}];
table = Table[
With[{seq = getMomentSequence[expr]},
{TraditionalForm@expr, TraditionalForm[seq],
Expand[FindSequenceFunction[seq][n]]}],
{expr, exprs}];
TableForm[table]
quarticCoeffs[ll_List /; Length[ll] == 5] := Module[{x}, CoefficientList[InterpolatingPolynomial[ll, x], x]]
seems to work for this. $\endgroup$