You can use this function:
floatisprime@(a)(round(a)==a)&isprime(round(a))
Logic seems a bit strange, but it's a prime if the value is integer (round(a)==a
) and the next integer is a prime (isprime(round(a)
)
If you use the setdiff-idea from the previous question, you don't have the issue:
noprimes=setdiff(a,primes(max(a)))
then iterate over noprimes