# Series for $(1+x)^{m}$ with specific notation

I'm trying to get mathematicas series function for $$(1+x)^{m}$$ to output a result that look like this:

$$(1+x)^{m} = \sum_{n=0}^{\infty} \frac{m !}{n !(m-n) !}x^{n}$$

However,

Clear["Global*"];
series[expr_, x_, x0_] :=
Defer[expr = Sum[#, {n, 0, \[Infinity]}]] &[
FullSimplify@
SeriesCoefficient[expr, {x, x0, n},
Assumptions -> {n >= 0}] (x - x0)^n]
series[(1 + x)^m, x, 0]


$$(1+x)^{m}=\sum_{n=0}^{\infty} x^{n}$$ Binomial $$[m, n]$$

How can I get the form without special function Binomial[m,n]?

$$\sum_{n=0}^{\infty} x^{n}$$ Binomial $$[m, n] ---> \sum_{n=0}^{\infty} \frac{m !}{n !(m-n) !}x^{n}$$

I know that this result can be achieved by slightly modifying the code, but I have tried and can't do it yet.

• "but I have tried and can't do it yet" Then what did you try? Commented Mar 16, 2022 at 11:11
• @xzczd Because FunctionExpand[Binomial[m, n]]==Gamma[1 + m]/(Gamma[1 + m - n] Gamma[1 + n]), so I modified some code in ComplexityFunction -> ((LeafCount@# + 10 Count[#, _Gamma | _Pochhammer, {0, \[Infinity]}]) &). But I can't get the result. Commented Mar 16, 2022 at 11:19
• (Binomial[m, n] // FunctionExpand[#] &) /. Gamma[1 + a_] :> Factorial[a] // TraditionalForm
– Syed
Commented Mar 16, 2022 at 11:20
• Simply define a rule: your expression /. Binomial[m_, n_] -> m!/(n! (m - n)!) Commented Mar 16, 2022 at 11:54
• @Syed I believe Gamma[a_] :> Factorial[a-1] is more robust (e.g. works on Gamma[2+n] and Gamma[n] etc.). Alternatively, one could simply write the rule to transform Binomial into factorials directly. Commented Mar 16, 2022 at 16:48

bitofac[test_] := test /. Binomial[n_, k_] -> n!/k!/(n - k)!
series[expr_, x_, x0_] :=
Defer[expr = Sum[#, {n, 0, \[Infinity]}]] &[
FullSimplify@
SeriesCoefficient[expr, {x, x0, n},
Assumptions -> {n >= 0}] (x - x0)^n] // bitofac
series[(1 + x)^m, x, 0]


Sadly, OP fails to understand the hint, so:

series[expr_, x_, x0_] :=
Defer[expr = Sum[#, {n, 0, ∞}]] &[
FullSimplify[#, Assumptions -> {m >= n >= 0 && {n, m} ∈ Integers}] &@
FunctionExpand@SeriesCoefficient[expr, {x, x0, n}] (x - x0)^n]
series[(1 + x)^m, x, 0]
`