Definitions
In mathematics, additive primes are prime numbers for which the sum of their decimal digits are also primes.



Task
Write a program to determine (and show here) all additive primes less than 500.

Optionally, show the number of additive primes.



Also see

   the OEIS entry:   A046704 additive primes.
   the prime-numbers entry:   additive primes.
   the geeks for geeks entry: additive prime number.
   the prime-numbers fandom: additive primes.


val .isPrime = f .i == 2 or .i > 2 and not any f(.x) .i div .x, pseries 2 to .i ^/ 2
 
val .sumDigits = f fold f{+}, s2n toString .i
 
writeln "Additive primes less than 500:"
 
var .count = 0
 
for .i in [2] ~ series(3..500, 2) {
    if .isPrime(.i) and .isPrime(.sumDigits(.i)) {
        write $"\.i:3;  "
        .count += 1
        if .count div 10: writeln()
    }
}
 
writeln $"\n\n\.count; additive primes found.\n"
 