Signed-off-by: BlackMinou <romain.chanoir@viacesi.fr>
--- /dev/null
+#!/usr/bin/env nit
+#
+# This file is part of NIT ( http://www.nitlanguage.org ).
+# This program is public domain
+
+# Task: Pernicious numbers
+#
+# SEE: http://rosettacode.org/wiki/Pernicious_numbers
+
+var n_pernicious = 0
+var x = 0
+while n_pernicious < 25 do
+ if x.number_bits(1).is_prime then
+ print x
+ n_pernicious += 1
+ end
+ x += 1
+end
+
+for i in [888888877..888888888[ do
+ if i.number_bits(1).is_prime then print i
+end
--- /dev/null
+3
+5
+6
+7
+9
+10
+11
+12
+13
+14
+17
+18
+19
+20
+21
+22
+24
+25
+26
+28
+31
+33
+34
+35
+36
+888888877
+888888878
+888888880
+888888883
+888888885
+888888886