28 lines
507 B
Text
28 lines
507 B
Text
function is_prime(atom n)
|
|
if n<2 then return false end if
|
|
for i=2 to floor(sqrt(n)) do
|
|
if mod(n,i)=0 then return false end if
|
|
end for
|
|
return true
|
|
end function
|
|
|
|
function pernicious(integer n)
|
|
return is_prime(sum(int_to_bits(n,32)))
|
|
end function
|
|
|
|
sequence s = {}
|
|
integer n = 1
|
|
while length(s)<25 do
|
|
if pernicious(n) then
|
|
s &= n
|
|
end if
|
|
n += 1
|
|
end while
|
|
?s
|
|
s = {}
|
|
for i=888_888_877 to 888_888_888 do
|
|
if pernicious(i) then
|
|
s &= i
|
|
end if
|
|
end for
|
|
?s
|