Skip to main content
Remove 15 bytes
Source Link
notjagan
  • 4.2k
  • 9
  • 27

Python 3, 125125 110 bytes

lambda s:eval(s.replace("][""]","]*[""1]*").replace("[","p[").replace("[]","[1]""p[1*")+"1")
p=2,
k=P=1
while k<1e4:
 if P%k:p+=k,
 P*=k*k;k+=1

Try it online!Try it online!

Uses xnor's implementation of the Wilson Theorem method to generate primes. Substitutes () with [].

Python 3, 125 bytes

lambda s:eval(s.replace("][","]*[").replace("[","p[").replace("[]","[1]"))
p=2,
k=P=1
while k<1e4:
 if P%k:p+=k,
 P*=k*k;k+=1

Try it online!

Uses xnor's implementation of the Wilson Theorem method to generate primes. Substitutes () with [].

Python 3, 125 110 bytes

lambda s:eval(s.replace("]","1]*").replace("[","p[1*")+"1")
p=2,
k=P=1
while k<1e4:
 if P%k:p+=k,
 P*=k*k;k+=1

Try it online!

Uses xnor's implementation of the Wilson Theorem method to generate primes. Substitutes () with [].

Remove 4 bytes
Source Link
notjagan
  • 4.2k
  • 9
  • 27

Python 3, 129125 bytes

p=2,
k=P=1
while k<4e3:
 iflambda P%ks:p+=k,
 P*=k*k;k+=1
print(eval(input()s.replace("][","]*[").replace("[","p[").replace("[]","[1]")))
p=2,
k=P=1
while k<1e4:
 if P%k:p+=k,
 P*=k*k;k+=1

Try it online!Try it online!

Uses xnor's implementation of the Wilson Theorem method to generate primes. Substitutes () with [].

Python 3, 129 bytes

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!

Uses xnor's implementation of the Wilson Theorem method to generate primes.

Python 3, 125 bytes

lambda s:eval(s.replace("][","]*[").replace("[","p[").replace("[]","[1]"))
p=2,
k=P=1
while k<1e4:
 if P%k:p+=k,
 P*=k*k;k+=1

Try it online!

Uses xnor's implementation of the Wilson Theorem method to generate primes. Substitutes () with [].

Source Link
notjagan
  • 4.2k
  • 9
  • 27

Python 3, 129 bytes

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!

Uses xnor's implementation of the Wilson Theorem method to generate primes.