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.


/# Rosetta Code problem: http://rosettacode.org/wiki/Additive_primes
by Galileo, 05/2022 #/
 
include ..\Utilitys.pmt
 
def isprime
    dup 1 <= if drop false
    else dup 2 == not if
        ( dup sqrt 2 swap ) for
            over swap mod not if drop false exitfor endif
        endfor
        endif
    endif
    false == not
enddef
 
def digitsum
    0 swap dup 0 > while dup 10 mod rot + swap 10 / int dup 0 > endwhile
    drop
enddef
 
0 500 for
    dup isprime over digitsum isprime and if print " " print 1 + else drop endif
endfor
 
"Additive primes found: " print print
 