# Python code to demonstrate the naive method
# to compute multifactorial
n = 7
fact = 1

if n % 3==1:
   for i in range(1, n+1, 3):
	     fact *=i

elif n % 3==2:
    for i in range(2,n+1,3):
        fact*=i

else:
  for i in range(3,n+1,3):
      fact*=i

print(f"The triple factorial of {n} is : ", end="")
print(fact)

Embed on website

To embed this project on your website, copy the following code and paste it into your website's HTML: