login
Product of digits + 1 is prime, product of digits - 1 is prime, sum of digits + 1 is prime, sum of digits - 1 is prime and product of digits = sum of digits.
1

%I #51 Feb 23 2018 23:13:50

%S 4,6,22,123,132,213,231,312,321,111126,111162,111216,111261,111612,

%T 111621,112116,112161,112611,116112,116121,116211,121116,121161,

%U 121611,126111,161112,161121,161211,162111,211116,211161,211611,216111,261111,611112

%N Product of digits + 1 is prime, product of digits - 1 is prime, sum of digits + 1 is prime, sum of digits - 1 is prime and product of digits = sum of digits.

%H Harry J. Smith, <a href="/A061597/b061597.txt">Table of n, a(n) for n = 1..81</a>

%e 22 belong to the sequence because (2*2)+1=5, (2*2)-1=3, (2+2)+1=5, (2+2)-1=3 and 2+2=2*2.

%o (PARI) SumD(x)= s=0; while (x>9, s=s+x-10*(x\10); x=x\10); s + x

%o ProdD(x)=p=1; while (x>9, p=p*(x-10*(x\10)); x=x\10); p*x

%o x=9; for (n=0, 78, until(s==p && isprime(s+1) && isprime(s-1) && isprime(p+1) && isprime(p-1), x++; s=SumD(x); p=ProdD(x)); write("b061597.txt", n, " ", x)) \\ _Harry J. Smith_, Jul 25 2009; does not produce the terms 4 and 6

%K nonn,base

%O 1,1

%A _Felice Russo_, May 22 2001

%E 4 and 6 added by Abdul Gaffar Khan, Nov 29 2015