C (gcc), (削除) 110 (削除ここまで) 104 bytes
t;d;p;r;f(a,l)int*a;{for(r=p=1;l--;++a){for(t=0;!t;)for(t=d=++p;--d>1;)t=t&&p%d;for(;(*a)--;)r*=p;}r=r;}
Inputs an array of prime exponents and its length and returns the product of primes to those exponents.
Explanation
i;t;d;p;r;f(a,l)int*a;{ // function taking an array of
// ints and its length l
for(i=0,r=p=1;i<l;++i){ // loop over the array elements
// setting the product r and
// the previous prime to 1
for(t=0;!t;) // loop until we find the next
// prime, t will flag this
for(t=d=++p;--d>1;) // set t to truthy, d to p
// bumped, bump d down and loop
// while d is >= 2
t=t&&p%d; // t remains truthy as long as
// p has no divisors
for(;a[i]--;)r*=p; // once we've found the next
// prime multiply r by it
// a[i] times
} //
d=r; // return r
} //
Noodle9
- 20.4k
- 3
- 23
- 47