' Name:     Special Pythagorean triplet
' Created:  1401-5-13
' Language: FreeBasic

const MAXN = 2000000
Dim as boolean IsNat(MAXN)
Dim as LongInt i, j, prs, sum
IsNat(1) = true
for i = 2 to MAXN 
	if not IsNat(i) then 
		sum = sum + i
		j = 2*i
		while j <= MAXN   
			IsNat(j) = true
			j = j+i
		wend 
	endif
next i
PRINT sum