func prime n .
   if n mod 2 = 0 and n > 2
      return 0
   .
   i = 3
   while i <= sqrt n
      if n mod i = 0
         return 0
      .
      i += 2
   .
   return 1
.
pri = 1
while nwag <> 10
   pri += 2
   if prime pri = 1
      wag = (pow 2 pri + 1) / 3
      if prime wag = 1
         nwag += 1
         print pri & " => " & wag
      .
   .
.
