In Easy Sequences 85, we define the hyperprimorial of n, as a exponent ladder of primes numbers from the n-th prime down to first prime (2). OEIS, however, defines hyperprimorial differently. In OEIS sequence #A076265, the hyperprimorial of n, (
) defined as follows:
where:
is the i-th prime number.
Using the above formula, we want to calculate
, which is the sum of all hyperprimorials from 1 to n:
For example:
Since this will involve large integers, please output a vector containing first 6, last 6, and the number of digits of
. Therefore, the final function output should be:
.
Solution Stats
Solution Comments
Show comments
Loading...
Problem Recent Solvers5
Suggested Problems
-
Find all elements less than 0 or greater than 10 and replace them with NaN
15829 Solvers
-
1077 Solvers
-
Find a subset that divides the vector into equal halves
406 Solvers
-
Construct an index vector from two input vectors in vectorized fashion
462 Solvers
-
Free Fall analytical solution (Chapra 2012 textbook Example 1.1)
27 Solvers
More from this Author116
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!