login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 59th year, we have over 358,000 sequences, and we’ve crossed 10,300 citations (which often say “discovered thanks to the OEIS”).

Other ways to Give
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A064156 Smallest prime with n decimal digits such that the product of its digits equals n times the sum of its digits, or 0 if no such prime exists. 1
2, 0, 167, 1427, 0, 126241, 1111457, 12222241, 111113543, 0, 0, 111111118273, 0, 0, 111111111126581, 1111111111144841, 0, 111111111111126443, 0, 11111111111122225421, 111111111111111135781, 0, 0, 111111111111111111244561, 1111111111111111121255521, 0, 111111111111111111111113797 (list; graph; refs; listen; history; text; internal format)
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

Sequence in context: A003321 A012333 A012329 * A269905 A012335 A012331

Adjacent sequences: A064153 A064154 A064155 * A064157 A064158 A064159

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

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified November 29 16:39 EST 2022. Contains 358431 sequences. (Running on oeis4.)