Ultra useful primes: Difference between revisions

Content added Content deleted
(Added C)
Line 326: Line 326:
see "works..." + nl
see "works..." + nl
limit = 10
limit = 10

for n = 1 to limit
for n = 1 to limit
k = 0
k = -1
flag = 0
flag = 0
while true
while true
k++
k = k + 2
num = pow(2,pow(2,n)) - k
num = pow(2,pow(2,n)) - k
if isPrime(num)
if isPrime(num)
Line 349: Line 350:
if (num % i = 0) return 0 ok
if (num % i = 0) return 0 ok
next
next
return 1
return 1
</syntaxhighlight>
</syntaxhighlight>
{{out}}
{{out}}