login
A061596
Product of digits + 1 is prime, product of digits - 1 is prime, sum of digits + 1 is prime and sum of digits - 1 is prime.
1
4, 6, 22, 114, 123, 129, 132, 141, 156, 165, 189, 192, 198, 213, 219, 231, 237, 273, 291, 312, 321, 327, 345, 354, 372, 411, 435, 453, 459, 468, 486, 495, 516, 534, 543, 549, 561, 594, 615, 648, 651, 684, 723, 732, 819, 846, 864, 891, 912, 918, 921, 945, 954
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) SumD(x)= { s=0; while (x>9, s=s+x-10*(x\10); x=x\10); return(s + x) } ProdD(x)= { p=1; while (x>9, p=p*(x-10*(x\10)); x=x\10); return(p*x) } { x=9; for (n=0, 1000, until(isprime(s+1) && isprime(s-1) && isprime(p+1) && isprime(p-1), x++; s=SumD(x); p=ProdD(x)); write("b061596.txt", n, " ", x) ) } \\ Harry J. Smith, Jul 25 2009
CROSSREFS
Sequence in context: A151519 A061595 A062940 * A061597 A075813 A107952
KEYWORD
base,nonn
AUTHOR
Felice Russo, May 22 2001
EXTENSIONS
First two terms prepended by Harvey P. Dale, Feb 04 2016
STATUS
approved