[go: up one dir, main page]

login
A066024
Numbers k such that the product of the digits of k minus the sum of the digits of k is prime.
2
24, 25, 27, 29, 33, 34, 35, 37, 38, 42, 43, 45, 47, 49, 52, 53, 54, 56, 57, 59, 65, 67, 72, 73, 74, 75, 76, 78, 79, 83, 87, 92, 94, 95, 97, 125, 126, 128, 133, 144, 146, 148, 152, 162, 164, 166, 182, 184, 188, 215, 216, 218, 222, 223, 225, 227, 229, 232, 245, 247
OFFSET
1,1
LINKS
EXAMPLE
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]
PROG
(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
CROSSREFS
Sequence in context: A004465 A271232 A167458 * A123608 A141587 A296866
KEYWORD
easy,nonn,base
AUTHOR
Enoch Haga, Dec 11 2001
STATUS
approved