OFFSET
1,1
LINKS
Harry J. Smith, Table of n, a(n) for n = 1..1000
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
KEYWORD
easy,nonn,base
AUTHOR
Enoch Haga, Dec 11 2001
STATUS
approved