The Smarandache prime-digital sequence (SPDS for brevity) is the sequence of primes whose digits are themselves prime.

For example 257 is an element of this sequence because it is prime itself and its digits: 2, 5 and 7 are also prime.

Task
 Show the first 25 SPDS primes.
 Show the hundredth SPDS prime.


See also

 OEIS A019546: Primes whose digits are primes.
 https://www.scribd.com/document/214851583/On-the-Smarandache-prime-digital-subsequence-sequences


arraybase 1
dim smar(100)
smar[1] = 2
 
cont = 1
i = 1
 
print 1, 2
while cont < 100
	i += 2
	if not isPrime(i) then continue while
	for j = 1 to length(string(i))
		digit = int(mid(string(i),j,1))
		if not isPrime(digit) then continue while
	next j
	cont += 1
	smar[cont] = i
	if cont = 100 or cont <= 25 then print cont, smar[cont]
end while
end
 
function isPrime(v)
	if v < 2 then return False
	if v mod 2 = 0 then return v = 2
	if v mod 3 = 0 then return v = 3
	d = 5
	while d * d <= v
		if v mod d = 0 then return False else d += 2
	end while
	return True
end function