# TWINSEARCH --- look for twin primes # # twinsearch(100,200) prints the list # of twin primes in the range [a,b] # and returns the number of twins # it finds. # # It has long been conjectured that # there are infinitely many twin primes. twinsearch := proc(a,b) local i, count; count := 0; for i from a to b do if isprime(i) and isprime(i+2) then print(i, i+2 ); count := count + 1; fi; od; RETURN( count ); end: # jac, 6/10/2001