class Sieve {
public static List<Integer> primes(Integer limit) {
if (limit < 2) return []
List<Integer> vet = new ArrayList<Integer>()
for(int i=2; i<= limit; i++) vet.add(i)
for(int n=0; n < vet.size(); ++n){
int num = vet[n]
vet.removeAll{ it > num && it % num == 0}
}
return vet
}
}
Thank you, friend!


I'm @steem.history, who is steem witness.
Thank you for witnessvoting for me.
please click it!
(Go to https://steemit.com/~witnesses and type fbslo at the bottom of the page)
The weight is reduced because of the lack of Voting Power. If you vote for me as a witness, you can get my little vote.
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit