login

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 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

a(n) is the smallest prime m such that prod(m) = n*length(m)*sum(m) where prod(m) is the product of the digits of m, length(m) is the number of digits of m, sum(m) is the sum of the digits of m; or 0 if no such m exists.
1

%I #14 Jan 11 2021 23:09:17

%S 2,347,5861,225461,55541,4583,4457,117883,15559,151687,0,155383,0,

%T 5857,118589,126487,0,4789,0,134587,7687,0,0,25867,165457,0,34759,

%U 182687,0,38557,0,44587,0,0,45757,25889,0,0,0,244567,0,148667,0,0,225689,0,0

%N a(n) is the smallest prime m such that prod(m) = n*length(m)*sum(m) where prod(m) is the product of the digits of m, length(m) is the number of digits of m, sum(m) is the sum of the digits of m; or 0 if no such m exists.

%C If n is divisible by a prime larger than 7, then n can't divide prod(m), so a(n)=0. Are there any other values of n with a(n)=0?

%e a(2)=347 because prod(347)=84, sum(347)=14, length(347)=3, n=2 and 84=2*3*14.

%t id := IntegerDigits; prod[n_] := Times@@id[n]; l[n_] := Length[id[n]]; sum[n_] := Plus@@id[n]; a[n_] := If[FactorInteger[2n][[ -1, 1]]>7, 0, For[k=1, True, k++, m=Prime[k]; If[prod[m]==n*l[m]sum[m], Return[m]]]]

%Y Cf. A007953 (sum), A007954 (prod), A055642 (length), A064022.

%K nonn,base

%O 1,1

%A _Felice Russo_, Sep 18 2001

%E Edited by _Dean Hickerson_, Jun 02 2002