A097227 Numbers m such that m = prime(d_1) * prime(d_2) * ... * prime(d_k), where d_1 d_2 ... d_k is the decimal expansion of m.
14, 154, 1196, 279174
Offset: 1
Examples
279174 = prime(2)*prime(7)*prime(9)*prime(1)*prime(7)*prime(4) so 279174 is in the sequence.
Programs
-
Mathematica
v={}; Do[h=IntegerDigits[n]; l=Length[h]; p=Product[h[[k]], {k, l}]; If[p>0&&Product[Prime[h[[k]]], {k, l}]==n, v=Append[v, n]; Print[v]], {n, 40000000}]
-
Python
from functools import reduce from operator import mul from itertools import combinations_with_replacement A097227_list, ptuple = [], (2,3,5,7,11,13,17,19,23) for l in range(1,12): for d in combinations_with_replacement(range(1,10),l): n = reduce(mul,(ptuple[i-1] for i in d)) if n < 10**l and tuple(sorted((int(x) for x in str(n)))) == d: A097227_list.append(n) # Chai Wah Wu, Aug 10 2017
Comments