cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

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.

This page as a plain text file.
%I A064156 #7 May 18 2013 16:49:30
%S A064156 2,0,167,1427,0,126241,1111457,12222241,111113543,0,0,111111118273,0,
%T A064156 0,111111111126581,1111111111144841,0,111111111111126443,0,
%U A064156 11111111111122225421,111111111111111135781,0,0,111111111111111111244561,1111111111111111121255521,0,111111111111111111111113797
%N 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.
%H A064156 Max Alekseyev, <a href="/A064156/b064156.txt">Table of n, a(n) for n=1..200</a>
%e A064156 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
%t A064156 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 ];
%t A064156 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} ]
%K A064156 nonn,base
%O A064156 1,1
%A A064156 _Felice Russo_, Sep 14 2001
%E A064156 Corrected and extended by _Robert G. Wilson v_, Oct 05 2001
%E A064156 a(14), a(20), a(25) and b-file from _Max Alekseyev_, May 07 2009