Concatenate two primes is also prime: Difference between revisions

Content added Content deleted
(julia example)
Line 78: Line 78:
isprime(n) && push!(found, n)
isprime(n) && push!(found, n)
end
end
return found
return sort!(unique(found))
end
end


foreach(p -> print(lpad(last(p), 5), first(p) % 16 == 0 ? "\n" : ""),
foreach(p -> print(lpad(last(p), 5), first(p) % 16 == 0 ? "\n" : ""),
catprimes(100) |> unique |> sort |> enumerate)
catprimes(100) |> enumerate)
</lang>{{out}}<pre>
</lang>{{out}}<pre>
23 37 53 73 113 137 173 193 197 211 223 229 233 241 271 283
23 37 53 73 113 137 173 193 197 211 223 229 233 241 271 283