Factorial primes: Difference between revisions

Added PureBasic
(Added PureBasic)
Line 242:
End</syntaxhighlight>
{{out}}
<pre>Same as FreeBASIC entry.</pre>
 
==={{header|PureBasic}}===
<syntaxhighlight lang="vb">;XIncludeFile "isprime.pb"
;XIncludeFile "factorial.pb"
 
If OpenConsole()
PrintN("First 10 factorial primes:")
Define found.i = 0, i,i = 1, fct.i
While found < 10
fct = factorial (i)
If isprime(fct-1)
found + 1
PrintN(RSet(Str(found),2) + ": " + RSet(Str(i),2) + "! - 1 = " + Str(fct-1))
EndIf
If isprime(fct+1)
found + 1
PrintN(RSet(Str(found),2) + ": " + RSet(Str(i),2) + "! + 1 = " + Str(fct+1))
EndIf
i + 1
Wend
PrintN(#CRLF$ + "--- terminado, pulsa RETURN---"): Input()
CloseConsole()
EndIf</syntaxhighlight>
{{out}}
<pre>Same as FreeBASIC entry.</pre>
2,130

edits