Combinatorics.jl icon indicating copy to clipboard operation
Combinatorics.jl copied to clipboard

Double factorial can be extended to negative ints

Open ron-wolf opened this issue 4 years ago • 0 comments

The following error may be averted, or such functionality made possible with an additional method:

https://github.com/JuliaMath/Combinatorics.jl/blob/c2114a71ccfc93052efb9a9379e62b81b9388ef8/src/factorials.jl#L47-L54

An example of how ‼︎ can be extended to the signed integers is found on Wikipedia at Ellipse § Circumference:

where $n‼︎$ is the double factorial (extended to negative odd integers 
by the recurrence relation $(2n-1)‼︎ = (2n+1)‼︎ / (2n+1)$, for $n ≤ 0$).

Would this be a useful addition to the library? Alternatively, if there are multiple distinct analytical continuations of ‼︎ for the negative integers, could I have a lead for how to implement it in Julia? Would this issue be a better fit for the SpecialFunctions library?

ron-wolf avatar Mar 02 '21 00:03 ron-wolf