OFFSET
1,1
COMMENTS
EXAMPLE
32233 is prime, its digits are primes (2 and 3), their sum is prime (3 + 2 + 2 + 3 + 3 = 13) and the sum of reciprocal of digits is also prime (1/3 + 1/2 + 1/2 + 1/3 + 1/3 = 2).
MAPLE
P:=proc(q) local a, b, k, ok, ok2, n;
for n from 1 to q do if isprime(n) then ok:=1; a:=0; for k from 0 to ilog10(n) do
if trunc(n/10^k) mod 10>0 then a:=a+1/(trunc(n/10^k) mod 10) else ok:=0; break; fi; od;
if ok=1 and type(a, integer) then if isprime(a) then a:=0; b:=n; ok2:=1;
for k from 1 to ilog10(n)+1 do if isprime(b mod 10) then a:=a+(b mod 10); b:=trunc(b/10);
else ok2:=0; break; fi; od; if ok2=1 and isprime(a) then print(n); fi; fi; fi; fi; od; end: P(10^9);
MATHEMATICA
Select[Select[Flatten@ Map[Map[FromDigits, Tuples[{2, 3, 5, 7}, #]] &, Range@ 11], PrimeQ], And[PrimeQ[Total@ #], PrimeQ[Total[1/#]]] &@ IntegerDigits@ # &] (* Michael De Vlieger, Mar 08 2016 *)
CROSSREFS
KEYWORD
nonn,easy,base
AUTHOR
Paolo P. Lava, Mar 08 2016
EXTENSIONS
More terms from Michael De Vlieger, Mar 08 2016
STATUS
approved