Skip to main content
3 of 6
added 93 characters in body
lynn
  • 69.2k
  • 11
  • 133
  • 283

Jelly, 17 bytes

Pµạ³,
»⁹ÆRœc7Ç€ṂṪ

Works in theory, but takes many years to complete.


Here is a version that actually works for the given inputs, but theoretically fails for large inputs:

Pµạ³,
50ÆRœc7Ç€ṂṪ

Try it here. This generates all primes up to 50, then finds all 7-combinations of primes in that list, and then all their products. Finally, it simply finds the closest element from that list to the given argument.

Of course, once our 7DPs contain primes higher than 50, this will fail. The theoretical version generates all primes up to 256n for an input n, but otherwise works the same way.

lynn
  • 69.2k
  • 11
  • 133
  • 283