15 lines
329 B
Text
15 lines
329 B
Text
#include "isprime.bas"
|
|
|
|
function iswief( byval p as uinteger ) as boolean
|
|
if not isprime(p) then return 0
|
|
dim as integer q = 1, p2 = p^2
|
|
while p>1
|
|
q=(2*q) mod p2
|
|
p = p - 1
|
|
wend
|
|
if q=1 then return 1 else return 0
|
|
end function
|
|
|
|
for i as uinteger = 1 to 5000
|
|
if iswief(i) then print i
|
|
next i
|