2
$\begingroup$

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?

$\endgroup$
  • $\begingroup$ Have you tried automating the process you followed above to see if it provides consistent results for other partial sums? $\endgroup$ – CA Trevillian Jun 20 at 21:36
  • $\begingroup$ @CATrevillian: yes, that is the exact result demonstrable on paper. $\endgroup$ – TeM Jun 20 at 21:38
  • $\begingroup$ using // FunctionExpand // FullSimplify (in place of Expand) gives 2^(-1 + n) (-1 + (2 Gamma[1/2 + n])/(Sqrt[\[Pi]] Gamma[n])) $\endgroup$ – kglr Jun 20 at 21:41
  • $\begingroup$ @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. $\endgroup$ – TeM Jun 20 at 21:43
  • $\begingroup$ @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? $\endgroup$ – CA Trevillian Jun 20 at 22:44
6
$\begingroup$
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 *)
$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.