Created
September 10, 2014 13:48
-
-
Save Mikescher/43dd385c6213888fd452 to your computer and use it in GitHub Desktop.
LINQ - Primes
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Enumerable.Range(2, 1000) | |
.Where(p => | |
!Enumerable.Range(2, p/2 + 1) | |
.Any(q => p%q == 0 && p-q != 0) | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment