Factors of a Mersenne number: Difference between revisions

m
→‎{{header|Phix}}: is_prime() now builtin
(Added Rust solution)
m (→‎{{header|Phix}}: is_prime() now builtin)
Line 2,114:
=={{header|Phix}}==
Translation/Amalgamation of BBC BASIC, D, and Go
<lang Phix>function is_primemodpow(integeratom x, atom n, atom m)
if n<2 then return 0 end if
if n=2 then return 1 end if
if remainder(n,2)=0 then return 0 end if
for i=3 to floor(sqrt(n)) by 2 do
if remainder(n,i)=0 then
return 0
end if
end for
return 1
end function
 
function modpow(atom x, atom n, atom m)
atom i = n,
y = 1,
7,815

edits