A068190 Largest number whose digit product equals n; a(n)=0 if no such number exists, e.g., when n has a prime factor larger than 7; no digit=1 is permitted to avoid an infinite number of solutions.
0, 2, 3, 22, 5, 32, 7, 222, 33, 52, 0, 322, 0, 72, 53, 2222, 0, 332, 0, 522, 73, 0, 0, 3222, 55, 0, 333, 722, 0, 532, 0, 22222, 0, 0, 75, 3322, 0, 0, 0, 5222, 0, 732, 0, 0, 533, 0, 0, 32222, 77, 552, 0, 0, 0, 3332, 0, 7222, 0, 0, 0, 5322, 0, 0, 733, 222222, 0, 0, 0, 0, 0
Offset: 1
Links
- David A. Corneth, Table of n, a(n) for n = 1..10000
Programs
-
Mathematica
Array[If[#[[-1, 1]] > 7, 0, FromDigits@ Reverse@ Flatten@ Map[ConstantArray[#1, #2] & @@ # &, #]] &@ FactorInteger@ # &, 69] /. 1 -> 0 (* Michael De Vlieger, Dec 08 2018 *)
-
PARI
a(n) = {my(res = []); for(i=2, 9, v = valuation(n, i); if(v > 0, res = concat(vector(v, j, i), res); n/=i^v)); if(n==1,fromdigits(res), 0)} \\ David A. Corneth, Jul 31 2017
Formula
If a solution exists, a(n) is the concatenation of prime factors with repetitions and in order of magnitude, otherwise a(n)=0.
Extensions
a(36) corrected by David A. Corneth, Jul 31 2017