7 kyu

The Hyperfactorial

327 of 350оkabe

Description:

Description

In mathematics, and more specifically number theory, the hyperfactorial of a positive integer nn is the product of the numbers 11,22,...,nn1^1 , 2^2, ..., n^n :

H(n)=11×22×33×...×(n1)n1×nnH(n) = 1^1 \times 2^2 \times 3^3 \times ... \times (n-1)^{n-1} \times n^n

H(n)=i=1niiH(n) = \prod_{i=1}^{n} i^i

Check out this Wikipedia article for more detail

Your task

Implement a function hyperfact(num) that takes a positive integer num and returns the hyperfactorial of it.

In order for your answer not to be too messy (hyperfactorial of 100 is 9015 digits long) give the answer modulo 1000000007.

Notes

1 <= n <= 300

50 random tests

Mathematics

More By Author:

Check out these other kata created by оkabe

Stats:

CreatedSep 16, 2022
PublishedSep 16, 2022
Warriors Trained518
Total Skips11
Total Code Submissions644
Total Times Completed350
Python Completions327
Ruby Completions37
Total Stars4
% of votes with a positive feedback rating86% of 96
Total "Very Satisfied" Votes72
Total "Somewhat Satisfied" Votes21
Total "Not Satisfied" Votes3
Total Rank Assessments48
Average Assessed Rank
7 kyu
Highest Assessed Rank
6 kyu
Lowest Assessed Rank
8 kyu
Ad
Contributors
  • оkabe Avatar
  • macambira Avatar
  • dfhwze Avatar
Ad