%I #32 Apr 23 2024 11:19:53
%S 12,25,35,111,112,125,222,245,333,335,445,1225,2225,11125,33445,
%T 334445,3333335,3334445,3444445,33333445,333333335,334444445,
%U 3333333335,33333334445,333333333335,33333333334445,33333333444445,444444444444445,2222222222222225,11111111111111125
%N For a positive number k, let L(k) denote the list consisting of k followed by the prime factors of k, with repetition, in nondecreasing order; sequence gives composite k such that the digits of L(k) are in nondecreasing order.
%C Terms cannot end in 4, 6, 8, or 9 because 2 would be a factor and no prime consists entirely of 9's. - _Michael S. Branicky_, Apr 22 2024
%H Michael S. Branicky, <a href="/A372029/b372029.txt">Table of n, a(n) for n = 1..48</a>
%H Michael S. Branicky, <a href="/A372029/a372029_1.txt">Table of n, a(n), and the prime factorization of a(n) for n = 1..48</a>
%e The initial terms and their factorizations are:
%e 12 = [2, 2, 3]
%e 25 = [5, 5]
%e 35 = [5, 7]
%e 111 = [3, 37]
%e 112 = [2, 2, 2, 2, 7]
%e 125 = [5, 5, 5]
%e 222 = [2, 3, 37]
%e 245 = [5, 7, 7]
%e 333 = [3, 3, 37]
%e 335 = [5, 67]
%e 445 = [5, 89]
%e 1225 = [5, 5, 7, 7]
%e 2225 = [5, 5, 89]
%e 11125 = [5, 5, 5, 89]
%e 33445 = [5, 6689]
%e 334445 = [5, 66889]
%e 3333335 = [5, 666667]
%e 3334445 = [5, 666889]
%e 3444445 = [5, 688889]
%e 33333445 = [5, 6666689]
%e 333333335 = [5, 66666667]
%e 334444445 = [5, 66888889]
%e ...
%e 12 is a term since the list L(12) is [12,2,2,3], in which the digits 1,2,2,2,3 are in nondecreasing order.
%e 121 is not a term since L(121) = [121,11,11], and the digits 1,2,1,1,1,1,1 are not in nondecreasing order.
%o (Python)
%o from sympy import factorint, isprime
%o def nd(s): return sorted(s) == list(s)
%o def ok(n):
%o if n < 4 or isprime(n): return False
%o s, f = str(n), "".join(str(p)*e for p, e in factorint(n).items())
%o return nd(s+f)
%o print([k for k in range(10**5) if ok(k)]) # _Michael S. Branicky_, Apr 22 2024
%o (Python) # faster for initial segment of sequence
%o from sympy import factorint, isprime
%o from itertools import count, islice, combinations_with_replacement as mc
%o def nd(s): return s == "".join(sorted(s))
%o def bgen(d): # can't end in 8 or 9
%o yield from ("".join(m) for m in mc("1234567", d))
%o def agen(): # generator of terms
%o for d in count(2):
%o for s in bgen(d):
%o t = int(s)
%o if any(s[-1] > c and t%int(c) == 0 for c in "2357"): continue
%o if isprime(t): continue
%o if nd(s+"".join(str(p)*e for p, e in factorint(t).items())):
%o yield t
%o print(list(islice(agen(), 25))) # _Michael S. Branicky_, Apr 22 2024
%Y Cf. A372053, A372055, A372034.
%K nonn,base
%O 1,1
%A _Scott R. Shannon_, Apr 16 2024
%E a(25) and beyond from _Michael S. Branicky_, Apr 22 2024