OFFSET
0,1
LINKS
Harvey P. Dale, Table of n, a(n) for n = 0..10000 (Terms 2 through 1002 from Harry J. Smith)
EXAMPLE
22 belongs to the sequence because (2*2)+1=5, (2*2)-1=3, (2+2)+1=5, (2+2)-1=3.
MATHEMATICA
pdQ[n_]:=Module[{idn=IntegerDigits[n]}, AllTrue[Flatten[{Times@@ idn+ {1, -1}, Total[idn]+{1, -1}}], PrimeQ]]; Select[Range[1000], pdQ] (* The program uses the AllTrue function from Mathematica version 10 *) (* Harvey P. Dale, Feb 03 2016 *)
PROG
(PARI) isok(k)={my(d=digits(k), s=vecsum(d), p=vecprod(d)); isprime(s+1) && isprime(s-1) && isprime(p+1) && isprime(p-1)} \\ Harry J. Smith, Jul 25 2009
CROSSREFS
KEYWORD
base,nonn
AUTHOR
Felice Russo, May 22 2001
EXTENSIONS
First two terms prepended by Harvey P. Dale, Feb 04 2016
STATUS
approved