Category Archives: Mathematical

Double factorial

Double factorial of a non-negative integer n, is the product of all the integers from 1 to n that have the same parity (odd or even) as n. It is also called as semifactorial of a number and is denoted by !!. For example, double factorial of 9 is 9*7*5*3*1 which is 945. Note that,… Read More »

Sum of Perrin Numbers

Given a number positive number n, find value of P0 + P1 + P2 + …. + Pn where pi indicates i’th Perrin number. First few Perrin numbers are 3, 0, 2, 3, 2, 5, 5, 7……. Examples: Input : 4 Output : 8 Explanation : 3 + 0 + 2 + 3 Input :… Read More »