# [Python 3], 129 bytes <!-- language-all: lang-python --> p=2, k=P=1 while k<4e3: if P%k:p+=k, P*=k*k;k+=1 print(eval(input().replace("][","]*[").replace("[","p[").replace("[]","[1]"))) [Try it online!][TIO-jb4hyjs0] [Python 3]: https://docs.python.org/3/ [TIO-jb4hyjs0]: https://tio.run/##VcpBCsIwEIXhfU4RAkLSBqHWVTV3yH6YRZFIw4Q6lKh4@ph0pf/ufTz@5OWxjqWwO1lBzrtBvJeYgqTrOYyTkPEu/YEm7h1ZIX3nqKML9fXHW1yzDq856bjyM2tz3AKn@Ra0QlBWYQfqxxrxv2AlGFAZY0oBQECEFrb2DTvV9QU "Python 3 – Try It Online" Uses [xnor's implementation](https://codegolf.stackexchange.com/a/27022) of the Wilson Theorem method to generate primes.