Skip to content

Instantly share code, notes, and snippets.

@jonatasemidio
Created April 26, 2013 18:00
Show Gist options
  • Save jonatasemidio/5469119 to your computer and use it in GitHub Desktop.
Save jonatasemidio/5469119 to your computer and use it in GitHub Desktop.
Calculo de números primos.
def t = 1..100
def v = []
t.each { n ->
(2..n).each { d ->
if (n % d == 0 && n != d)
v.add(n)
}
}
println t - v - 1​
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment