Given a number, the task is to find the Superfactorial of a number. The result of multiplying the product of first n factorials is called Superfactorial of a number.
Superfactorial(n)= 1 ^ n * 2 ^ (n-1) * 3 ^ (n-2) * . . . . . * n ^ 1
Input : 3
Output : 12
H(3) = 1! * 2! * 3! = 12
Input : 4
Output : 288
H(4) = 1^4 * 2^3 * 3^2 * 4^1 = 288
An efficient approach is to compute all factorial iteratively till n, then compute the product of all factorial till n.
Attention geek! Strengthen your foundations with the Python Programming Foundation Course and learn the basics.
To begin with, your interview preparations Enhance your Data Structures concepts with the Python DS Course.
- Python | Find the Number Occurring Odd Number of Times using Lambda expression and reduce function
- Number of ways to divide a given number as a set of integers in decreasing order
- Get the number of rows and number of columns in Pandas Dataframe
- Find the position of number that is multiple of certain number
- Analysis of Different Methods to find Prime Number in Python
- Print number with commas as 1000 separators in Python
- Python program to count number of vowels using sets in given string
- Python | Minimum number of subsets with distinct elements using Counter
- Python map function to find row with maximum number of 1's
- Python Bin | Count total bits in a number
- Python | Check if there are K consecutive 1's in a binary number
- Python implementation of automatic Tic Tac Toe game using random number
- Python program to convert float decimal to Octal number
- Python | Count the Number of matching characters in a pair of string
- Python program to check whether a number is Prime or not
- Python program to find largest number in a list
- Python program to find smallest number in a list
- Python program to find second largest number in a list
- Python program to create a list of tuples from given list having number and its cube in each tuple
- Python | Number of values greater than K in list
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to email@example.com. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.