How can we code the hypergeometric function $$ f(n,k,z)={_nF}_{n-1}{\huge(}{1-k,\overbrace{2,\dots,2}^{n-1\ \text{times}} \atop \underbrace{1,\dots,1}_{n-1\ \text{times}}};z{\huge)} $$ as a function that accepts any $n=1,2,3,\dots$? This function reduces to a rational function in $z$ but that is not what I'm after. I apologize for lack of an attempt here...did not have any idea where to start.


I would do it this way:

aaronF[n_Integer?Positive, k_, z_] :=
  HypergeometricPFQ[Prepend[ConstantArray[2, n - 1], 1 - k], ConstantArray[1, n - 1], z]

For example:

aaronF[5, 4, z]
   1 - 48 z + 243 z^2 - 256 z^3
| improve this answer | |
  • $\begingroup$ @JM Thank you. Exactly what I was looking for. $\endgroup$ – Aaron Hendrickson May 30 at 13:17

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.