0
$\begingroup$

I have a following sequence:

 Table[Sum[Sum[(1 + j + k + n)!/((1 + j + k) j! k! ), {j, 0, n}], {k, 0, n}], {n, 1, 5}]
 (* {16, 542, 31488, 2646024, 292224000} *)

The sum inside can be evaluated:

 Sum[(1 + j + k + n)!/((1 + j + k) j! k! ), {j, 0, n}]
 (* -(((2 + k + 2 n)! HypergeometricPFQ[{1, 2 + k + n, 3 + k + 2 n}, {2 + n, 3 + k + n}, 1])/((2 + k + n) k! (1 + n)!)) *)

But the same sum with substitution gives an error message.

 Table[Sum[-(((2 + k + 2 n)! HypergeometricPFQ[{1, 2 + k + n, 3 + k + 2 n}, {2 + n, 3 + k + n}, 1])/((2 + k + n) k! (1 + n)!)), {k, 0, n}], {n, 1, 5}]
 (* Infinity::indet: Indeterminate expression ComplexInfinity+ComplexInfinity encountered. *)

Why aren't the results the same?

$\endgroup$
2
  • $\begingroup$ Are you aware that you don't need to use Sum[] twice? Sum[(1 + j + k + n)!/((1 + j + k) j! k!), {j, 0, n}, {k, 0, n}] $\endgroup$ Apr 3, 2019 at 12:59
  • $\begingroup$ Yes, of course (see tens of my programs in the OEIS, for example in oeis.org/A144661) $\endgroup$ Apr 3, 2019 at 13:07

1 Answer 1

3
$\begingroup$

The problem that the hypergeometric result returned is not good for integer arguments:

Table[HypergeometricPFQ[{1, 2 + k + n, 3 + k + 2 n}, {2 + n, 3 + k + n}, 1],
      {n, 2}, {k, 0, n}]
   {{ComplexInfinity, ComplexInfinity}, {ComplexInfinity, ComplexInfinity, ComplexInfinity}}

which spoils further computations.

A useful tactic is to flip indices in the inner sum:

Sum[(1 + n - j + k + n)!/((1 + n - j + k) (n - j)! k!), {j, n, 0, -1}]
   ((1 + k + 2 n)! HypergeometricPFQ[{1, -1 - k - n, -n}, {-1 - k - 2 n, -k - n}, 1])/
   ((1 + k + n) k! n!)

which should now be usable:

Table[Sum[((1 + k + 2 n)! HypergeometricPFQ[{1, -1 - k - n, -n},
          {-1 - k - 2 n, -k - n}, 1])/((1 + k + n) k! n!), {k, 0, n}], {n, 1, 5}]
   {16, 542, 31488, 2646024, 292224000}

It should be noted that index flipping does not always give a useful result, but we are fortunate in this case.

$\endgroup$
1
  • $\begingroup$ Yes, this is a good idea, thank you! $\endgroup$ Apr 3, 2019 at 13:22

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.