0
$\begingroup$

I am trying to understand if and how I can use multiple placeholders in order to define a function that will perform more than one operations on special functions; more accurately, sums, products, etc of special functions.

An example of that, is the following one from my calculations:

I have the following list of numbers

{2, 504/13, 14112/85, 118272/323, 5930496/10925, 2050048/3335, \
177422336/310155, 381026304/831575, 444530688/1363783, \
61746184192/293213345, 11938037760/95041567, \
1354424647680/19336360099, 113850187776/3087317999, \
205245615439872/11111257478401, 63709397385216/7191496660985, \
99591701659648/24356255724347}

Using the command FindSequenceFunction

FindSequenceFunction[{2, 504/13, 14112/85, 118272/323, 5930496/10925, 
     2050048/3335, 177422336/310155, 381026304/831575, 444530688/
     1363783, 61746184192/293213345, 11938037760/95041567, 
     1354424647680/19336360099, 113850187776/3087317999, 
     205245615439872/11111257478401, 63709397385216/7191496660985, 
     99591701659648/24356255724347}, m] /. m -> m + 1 // 
  FullSimplify // FunctionExpand

I can obtain the following relation

(2^(-13 - 
  2 m) (1 + m) (2 + m) (1 + 2 m) (3 + 2 m) (5 + 2 m) Sqrt[\[Pi]]
  Gamma[11 + 2 m])/(225 Gamma[11/2 + 2 m])

In order to introduce to Mathematica the following facts about the $\Gamma$-function

$$\Gamma(n) = (n-1)!$$

$$\Gamma \Big(\frac{1}{2} + n \Big) = \frac{(2 n)!}{4^n n!} \sqrt{\pi}$$

I have defined the following functions.

gammatofactorial[function_] := (# - 1)! &@function 
halfgammatofactorial[function_] := (2 #)!/(4^# (#)!) Sqrt[\[Pi]] &@
  function

In order to apply this to the above example I perform the following steps

gammatofactorial[11 + 2 m]

(10 + 2 m)!

Solve[11/2 == 1/2 + s1, s1]

{{s1 -> 5}}

 halfgammatofactorial[5 + 2 m] // Simplify

 (4^(-5 - 2 m) Sqrt[\[Pi]] (10 + 4 m)!)/(5 + 2 m)!

using the above I can re-write the result of the FindSequenceFunction command in a nice and convenient way.

My question is the following:

Is there any way to write one function to perform all of the above at one step? Or in two steps instead of three?

This is my effort to combine the two properties of the $\Gamma$ function without the solve

combinationofgammafunctions[function_] := 
 gammatofactorial[#1]/halfgammatofactorial[#2] &@function

But I failed,

combinationofgammafunctions[(11 + 2 m)/(5 + 2 m)]
Function::slotn: Slot number 2 in gammatofactorial[#1]/halfgammatofactorial[#2]& cannot be filled from (gammatofactorial[#1]/halfgammatofactorial[#2]&)[(11+2 m)/(5+2 m)].
(4^#2 (-1 + (11 + 2 m)/(5 + 2 m))! #2!)/(Sqrt[\[Pi]] (2 #2)!)

Thank you.

$\endgroup$
  • 1
    $\begingroup$ In order to use two Slots, you need to supply your function with two arguments. That is, you need to do f[#1]/g[#2] & [x,y] rather than f[#1]/g[#2] & @ (x/y). That said, you might want to use replacement rules in this case, rather than explicitly separating out the different types of gamma functions yourself and then applying functions to them. $\endgroup$ – jjc385 Feb 8 '18 at 4:58
  • $\begingroup$ Thank you. I will try it. $\endgroup$ – Konstantinos Feb 8 '18 at 18:05

Your Answer

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

Browse other questions tagged or ask your own question.