05AB1E, 20 bytes
Lpvyi1LÒN>¢àN>*ˆ}} ̄P
Explanation
Lpv # for each item in isprime(range(1,N)): N=7 -> [0,1,1,0,1,0,1]
yi # if prime
1LÒN>¢ # count occurrences of the prime
in the prime-factorization of range(1,N):
p=2 -> [0,1,0,2,0,1,0]
àN>*ˆ # add max occurrence of that prime multiplied by the prime
to global array: N=7 -> [4,3,5,7]
}} # end if/loop
̄P # get product of global array
Emigna
- 53.2k
- 5
- 44
- 164