Double factorial

The double factorial of a non-negative integer n, denoted by n factorial factorial, is defined as the product of all integers between 1 and n that have the same parity as n:

n factorial factorial space equals open curly brackets table attributes columnalign left end attributes row cell n times left parenthesis n minus 2 right parenthesis times left parenthesis n minus 4 right parenthesis space midline horizontal ellipsis space 4 space times space 2 space text if n is even end text space end cell row cell n times left parenthesis n minus 2 right parenthesis times left parenthesis n minus 4 right parenthesis midline horizontal ellipsis 3 times 1 text if n is odd end text end cell end table close

0 factorial factorial equals 1 by convention.

Integer!!

Given an integer between 1 and 65535, returns n factorial factorial.