Pierpont primes: Difference between revisions
nine is prime now?
m (added incorrect template) |
(nine is prime now?) |
||
Line 715:
=={{header|FreeBASIC}}==
<lang freebasic>#define NPP 50
Line 740 ⟶ 739:
function is_pierpont( n as uinteger ) as uinteger
if not is_prime(n) then return 0 'not prime
if
if p1 then return 1 'pierpont prime of the 1st kind
if p2 then return 2 'pierpont prime of the 2nd kind
return 0 'prime, but not pierpont
end function
Line 750 ⟶ 751:
j = is_pierpont(x)
if j>0 then
if np(1) <= NPP then pier(
end if
if j > 1 then
np(2) += 1
if np(2) <= NPP then pier(2, np(2)) = x
end if
end if
wend
|