//Program finds primes separated by an even number (called gap) which
//have a power of two between them. Program starts with the smallest
//power of two above gap. Primes less than this starting point can be
//checked by inspection.
for i:= start to 1000 do
for k:=powerof2-gap+1 to powerof2-1 by 2 do
if (IsPrime(k) and IsPrime(k+gap)) then k;