Pierpont primes: Difference between revisions

nine is prime now?
m (added incorrect template)
(nine is prime now?)
Line 715:
 
=={{header|FreeBASIC}}==
{{incorrect|FreeBASIC|Pierpont primes can be of the first kind AND the second kind ex. 3, 5, 7, 9.}}
<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
ifdim as integer p1 = is_23(n+1), thenp2 return= is_23(n-1 'pierpont prime of the 1st kind)
if is_23(n-1)p1 and p2 then return 23 'pierpont prime of the 2ndboth kindkinds
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
np(if j) +mod 2 = 1 then
if np(j1)>NPP then continue+= while1
if np(1) <= NPP then pier(j1, np(j1)) = x
end if
if j > 1 then
np(2) += 1
if np(2) <= NPP then pier(2, np(2)) = x
end if
end if
wend
781

edits