Merge: doc: fixed some typos and other misc. corrections
[nit.git] / examples / rosettacode / pernicious_numbers.nit
1 #!/usr/bin/env nit
2 #
3 # This file is part of NIT ( http://www.nitlanguage.org ).
4 # This program is public domain
5
6 # Task: Pernicious numbers
7 #
8 # SEE: http://rosettacode.org/wiki/Pernicious_numbers
9
10 var n_pernicious = 0
11 var x = 0
12 while n_pernicious < 25 do
13 if x.number_bits(1).is_prime then
14 print x
15 n_pernicious += 1
16 end
17 x += 1
18 end
19
20 for i in [888888877..888888888[ do
21 if i.number_bits(1).is_prime then print i
22 end