Ultra useful primes: Difference between revisions

Added FreeBasic
m (→‎{{header|J}}: timings are not particularly useful, since they do not retain information about the machine which they are diagnosing)
(Added FreeBasic)
Line 139:
1 3 5 15 5 59 159 189 569 105
</pre>
 
=={{header|FreeBASIC}}==
{{trans|Ring}}
<syntaxhighlight lang="vb">#include "isprime.bas"
 
Dim As Longint n, k, limit = 10
Dim As ulongint num
For n = 1 To limit
k = -1
Do
k += 2
num = (2 ^ (2 ^ n)) - k
If isPrime(num) Then
Print "n = "; n; " k = "; k
Exit Do
End If
Loop
Next
 
Sleep</syntaxhighlight>
 
=={{header|Go}}==
2,148

edits