I am trying to make a function to check whether the value is a prime number or not using tail recursive function, so please can someone help me with this
`
declare
fun {PrimeR X D}
if X==2 orelse X==3 then 1
elseif X<2 andthen ((X mod D)==0) andthen D =< X then 0
elseif ((X mod D)\=0) then 1
else {PrimeR X D+1}
end
end
{Browse {PrimeR 6 1}}
`