OFFSET
2,1
COMMENTS
LINKS
Lucas A. Brown, Python program.
FORMULA
a(n) = A006530(A370849(n)) unless the smoothest solution is (as for n = 21) a number made of digits {0, 1}, currently excluded in A370849. - M. F. Hasler, Mar 05 2024
EXAMPLE
a(7) = 29 as the largest prime factor of the 7-digit number with exactly two distinct digits, 1111222, is 29 and no 7-digit number with exactly two distinct digits has a smaller largest prime factor and no 7-digit number with exactly two distinct digits smaller than 1111222 has a largest prime factor that is equal to 29. - David A. Corneth, Mar 05 2024
a(9) = 19, because 799779977 = 17*19^6 has nine digits, two distinct digits and largest prime factor 19. - Ed Pegg Jr, Mar 05 2024
PROG
(Python)
from sympy import primefactors
from sympy.utilities.iterables import multiset_permutations
def A370361(n): return min((max(primefactors(a:=int(''.join(s)))), a) for i in range(10) for j in range(i+1, 10) for k in range(1, n) for s in multiset_permutations(str(i)*k+str(j)*(n-k)) if s[0] != '0' and s[-1] != '0')[0] # Chai Wah Wu, Mar 09 2024
(Python) # See LINKS. Lucas A. Brown, Mar 30 2024
CROSSREFS
KEYWORD
nonn,hard,more,base
AUTHOR
Ed Pegg Jr, Mar 05 2024
EXTENSIONS
a(21)-a(23) from Michael S. Branicky, Mar 05 2024
a(24)-a(25) from David A. Corneth, Mar 05 2024
a(26)-a(30) from Don Reble, Mar 06 2024
a(31) from Lucas A. Brown, Mar 30 2024
STATUS
approved