OFFSET
1,1
LINKS
Max Alekseyev, Table of n, a(n) for n=1..200
EXAMPLE
167 belongs to the sequence because this is the smallest prime with 3 digits such that 1*6*7=42 and 3*(1+6+7)=42
MATHEMATICA
NextPrim[ n_ ] := (k = n + 1; While[ ! PrimeQ[ k ], k++ ]; k); Do[ If[ n != 1 && Transpose[ FactorInteger[ n ] ][ [ 1, -1 ] ] <= 10, k = NextPrim[ (10^n - 1)/9 ];
While[ d = IntegerDigits[ k ]; k < 10^n && n*Apply[ Plus, d ] != Apply[ Times, d ], k = NextPrim[ k ] ]; If[ k < 10^n, Print[ k ], Print[ 0 ] ], If[ n == 1, Print[ 2 ], Print[ 0 ] ] ], {n, 1, 9} ]
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Felice Russo, Sep 14 2001
EXTENSIONS
Corrected and extended by Robert G. Wilson v, Oct 05 2001
a(14), a(20), a(25) and b-file from Max Alekseyev, May 07 2009
STATUS
approved