Skip to main content
-3 bytes
Source Link
user42649
  • 42.8k
  • 5
  • 72
  • 227

Jelly, 88 5 bytes

Æf=2+ÆfPÆf3»P Æf=2+ÆfPÆf3»P Main Link, argument is z Æf  Prime factors  =2  Compare the elements to two (returns 1 if it is)  +Æf Takes maximum Addof it3 toand the primevalue factorsfor (thuseach makingvalue allin 2sthe 3s)array   P Takes the product of the whole thing 

Shameless port of @Emigna's 05AB1E answer but this is longer because I need to restate Æf after the addition (I think) :(Try it online!

Try it online!-3 bytes thanks to a hint from @Dennis!

Jelly, 8 bytes

Æf=2+ÆfP Æf=2+ÆfP Main Link, argument is z Æf  Prime factors  =2  Compare the elements to two (returns 1 if it is)  +Æf Add it to the prime factors (thus making all 2s 3s)   P Takes the product 

Shameless port of @Emigna's 05AB1E answer but this is longer because I need to restate Æf after the addition (I think) :(

Try it online!

Jelly, 8 5 bytes

Æf3»P Æf3»P Main Link, argument is z Æf Prime factors  Takes maximum of 3 and the value for each value in the array P Takes the product of the whole thing 

Try it online!

-3 bytes thanks to a hint from @Dennis!

Source Link
user42649
  • 42.8k
  • 5
  • 72
  • 227

Jelly, 8 bytes

Æf=2+ÆfP Æf=2+ÆfP Main Link, argument is z Æf Prime factors =2 Compare the elements to two (returns 1 if it is) +Æf Add it to the prime factors (thus making all 2s 3s) P Takes the product 

Shameless port of @Emigna's 05AB1E answer but this is longer because I need to restate Æf after the addition (I think) :(

Try it online!