Skip to main content
We’ve updated our Terms of Service. A new AI Addendum clarifies how Stack Overflow utilizes AI interactions.
Code Golf

Return to Revisions

2 of 2
Commonmark migration

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

Try it online

Emigna
  • 53.2k
  • 5
  • 44
  • 164

AltStyle によって変換されたページ (->オリジナル) /