23 lines
406 B
Text
23 lines
406 B
Text
import isprime
|
|
|
|
print "The first 100 G numbers are:"
|
|
|
|
col = 1
|
|
for n = 4 to 202 step 2
|
|
print g(n) using ("####");
|
|
if mod(col, 10) = 0 print
|
|
col = col + 1
|
|
next n
|
|
|
|
print "\nG(1000000) = ", g(1000000)
|
|
end
|
|
|
|
sub g(n)
|
|
count = 0
|
|
if mod(n, 2) = 0 then
|
|
for i = 2 to (1/2) * n
|
|
if isPrime(i) and isPrime(n - i) count = count + 1
|
|
next i
|
|
fi
|
|
return count
|
|
end sub
|