# Calculation of sum \begin{aligned}\sum_{k = 1}^{n - 1}\end{aligned}\left(1+\cos\left(\frac{k\,\pi}{n}\right)\right)^n

Having established that Mathematica cannot calculate the following summation:

sum = Sum[(1 + Cos[k Pi/n])^n, {k, 1, n - 1}]


I implemented the classic "plan B", ie I tabulated some values and then searched for a sequence function:

Table[sum, {n, 10}] // FullSimplify;
sum = FindSequenceFunction[%, n] // Expand


obtaining:

-2^(-1 + n) + (2^n (-1/2 + n)!)/(Sqrt[Pi] (-1 + n)!)

On the other hand, I also know that:

sum == -2^(-1 + n) + n/2^n Binomial[2 n, n] // FullSimplify


and indeed:

True

So the question is: is there a way to "oblige" Mathematica to give me the result in this last form that is easier for me?

• Have you tried automating the process you followed above to see if it provides consistent results for other partial sums? – CA Trevillian Jun 20 at 21:36
• @CATrevillian: yes, that is the exact result demonstrable on paper. – TeM Jun 20 at 21:38
• using // FunctionExpand // FullSimplify (in place of Expand) gives 2^(-1 + n) (-1 + (2 Gamma[1/2 + n])/(Sqrt[\[Pi]] Gamma[n])) – kglr Jun 20 at 21:41
• @kglr: yes, I had already tried, but is the gamma function avoidable? I would very much like to get the binomial function, if possible obviously. – TeM Jun 20 at 21:43
• @TeM ah okay, I understand now, so you want the answer to come in a form that uses a specific function, the Binomial function? Perhaps you can use some form of pattern matching to apply/implement an auto replacement? – CA Trevillian Jun 20 at 22:44

seq = Table[Sum[(1 + Cos[k Pi/n])^n, {k, 1, n - 1}], {n, 10}] //
FullSimplify;

sum1 = FindSequenceFunction[seq, n] // FullSimplify

(* 2^(-1 + n) (-1 + (2 Gamma[1/2 + n])/(Sqrt[π] Gamma[n])) *)


To convert the ratio of Gamma functions to a Binomial function

repl = Gamma[a_]/Gamma[b_] :>
Gamma[1 + a - b] Binomial[a - 1, b - 1];

sum2 = sum1 /. repl

(* 2^(-1 + n) (-1 + Binomial[-(1/2) + n, -1 + n]) *)


Looking at the complexity of the different representations

LeafCount /@ {sum1, sum2, -2^(-1 + n) + n/2^n Binomial[2 n, n]}

(* {25, 17, 20} *)


Verifying the equivalence of the different representations

FullSimplify[
Equal @@ {sum1, sum2, -2^(-1 + n) + n/2^n Binomial[2 n, n]}]

(* True *)