login
Numbers k such that the product of the digits of k minus the sum of the digits of k is prime.
2

%I #11 Jun 16 2018 19:09:56

%S 24,25,27,29,33,34,35,37,38,42,43,45,47,49,52,53,54,56,57,59,65,67,72,

%T 73,74,75,76,78,79,83,87,92,94,95,97,125,126,128,133,144,146,148,152,

%U 162,164,166,182,184,188,215,216,218,222,223,225,227,229,232,245,247

%N Numbers k such that the product of the digits of k minus the sum of the digits of k is prime.

%H Harry J. Smith, <a href="/A066024/b066024.txt">Table of n, a(n) for n = 1..1000</a>

%e a(1)=24 because 2 + 4 = 6, 2*4 = 8, and 8 - 6 = 2, which is prime. [corrected by _Harry J. Smith_, Nov 07 2009]

%o (PARI) ProdD(x)= { local(p=1); while (x>9 && p>0, p*=x%10; x\=10); return(p*x) } SumD(x)= { local(s=0); while (x>9, s+=x%10; x\=10); return(s + x) } { n=0; for (m=1, 10^9, if (isprime(ProdD(m) - SumD(m)), write("b066024.txt", n++, " ", m); if (n==1000, return)) ) } \\ _Harry J. Smith_, Nov 07 2009

%Y Cf. A038369, A066027.

%K easy,nonn,base

%O 1,1

%A _Enoch Haga_, Dec 11 2001