OFFSET
1,1
COMMENTS
They follow the same formula for Smith numbers, however, instead of addition, we have multiplication (only nonzero digits are included).
Trivially, prime numbers satisfy this property but are not included in the sequence.
LINKS
T. D. Noe, Table of n, a(n) for n = 1..1000
EXAMPLE
1236 is a member of this sequence because 1236 = 2*2*3*103 and 1*2*3*6 = 2*2*3*1*3 (zeros are not included).
998 is a member of this sequence because 998 = 2*499 and 9*9*8 = 2*4*9*9.
MATHEMATICA
f[n_] := Times @@ DeleteCases[IntegerDigits[n], 0]; pFactors[n_] := Module[{f = FactorInteger[n]}, Flatten[ConstantArray @@@ f]]; Select[Range[2, 10000], ! PrimeQ[#] && f[#] == Times @@ f /@ pFactors[#] &] (* T. D. Noe, Nov 28 2013 *)
msnQ[n_]:=Times@@(Flatten[IntegerDigits/@Table[#[[1]], #[[2]]]&/@ FactorInteger[ n]]/.(0->1))==Times@@(IntegerDigits[n]/.(0->1)); Select[ Range[ 5000], CompositeQ[#]&&msnQ[#]&] (* Harvey P. Dale, Jan 15 2022 *)
PROG
(Python)
import sympy
from sympy import isprime
from sympy import factorint
def DigitProd(x):
prod = 1
for i in str(x):
if i != '0':
prod *= int(i)
return prod
def f(x):
lst = []
for n in range(len(list(factorint(x)))):
lst.append(str(list(factorint(x))[n])*list(factorint(x).values())[n])
string = ''
for i in lst:
string += i
prod = 1
for a in string:
if a != '0':
prod *= int(a)
if prod == DigitProd(x):
return True
x = 4
while x < 10**3:
if not isprime(x):
if f(x):
print(x)
x += 1
(Sage)
def prodPrimeDig(x):
F=factor(x)
T=[item for sublist in [[y[0]]*y[1] for y in F] for item in sublist]
return prod([prod(filter(lambda a: a!=0, h.digits(base=10))) for h in T])
n=3345 #Change n for more digits
[k for k in [1..n] if prod(filter(lambda a: a!=0, k.digits(base=10)))==prodPrimeDig(k) and not(is_prime(k))] # Tom Edgar, Nov 26 2013
CROSSREFS
KEYWORD
nonn,base,easy
AUTHOR
Derek Orr, Nov 25 2013
EXTENSIONS
Extended by T. D. Noe, Nov 28 2013
STATUS
approved