Skip to main content
added 50 characters in body
Source Link
Luis Mendo
  • 105.3k
  • 9
  • 135
  • 372

Python 3, 6868 67 bytes

1 byte removed thanks to @Mr.Xcoder

lambda n:sum(alln%k<all(k%j for j in range(2,k))>n%k for k in range(2,n+1))

This times out for the largest test cases. Try it online!Try it online!

Python 3, 68 bytes

lambda n:sum(all(k%j for j in range(2,k))>n%k for k in range(2,n+1))

This times out for the largest test cases. Try it online!

Python 3, 68 67 bytes

1 byte removed thanks to @Mr.Xcoder

lambda n:sum(n%k<all(k%j for j in range(2,k))for k in range(2,n+1))

This times out for the largest test cases. Try it online!

Source Link
Luis Mendo
  • 105.3k
  • 9
  • 135
  • 372

Python 3, 68 bytes

lambda n:sum(all(k%j for j in range(2,k))>n%k for k in range(2,n+1))

This times out for the largest test cases. Try it online!