Problem 45189. Double Factorial
Return double factorial
n(n-2)...(5)(3)(1), n>0, odd
n!! = n(n-2)...(6)(4)(2), n>0, even
1 , n = -1, or n = 0For example
6!! = (6)(4)(2) = 48
Solution Stats
Problem Comments
-
1 Comment
Atsushi Ueno
on 17 Nov 2019
Neither n = -1, nor n = 0 are tested.
Solution Comments
Show commentsProblem Recent Solvers67
Suggested Problems
-
Return the first and last characters of a character array
11744 Solvers
-
Arrange vector in ascending order
813 Solvers
-
Flip the vector from right to left
10616 Solvers
-
Matrix of almost all zeros, except for main diagonal
189 Solvers
-
the average value of the elements
2185 Solvers
More from this Author92
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!