for i=500 to 600 for j=2 to i if i can divide j break (i is not prime number) if j equals to (i-1) print i (i is prime number)