|
|
A370849
|
|
Least of the smoothest two-nonzero-digit numbers of length n.
|
|
1
|
|
|
16, 144, 3888, 55566, 255552, 1111222, 76776777, 799779977, 4334433444, 61161166611, 292229292292, 1122121111111, 55115551555155, 799777779779979, 1161111111166611, 11112112121222112, 111111222221111112, 3334334333334333333, 55333333335335355355, 222229999999292992929, 3383383883833883388888, 11112221111212222222221, 112122222222122122122112, 2777227772777277722272272, 61666616611611166166161116, 858885585585555585558558858, 3331333133331111313111133133, 98888999899889989898999889999, 111661111111666616661166166616
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
2,1
|
|
COMMENTS
|
"Least" means that we list the smallest one if there is more than one solution of length n having the same smoothness. "Smoothest" means having the least greatest prime factor, A006530. Length means the number of digits in base 10. We consider only nonzero digits since otherwise the somewhat uninteresting solution would most often be 10^(n-1) = (2*5)^(n-1). [Alternatively, one might exclude those solutions by only forbidding multiples of 10: see below.]
In an alternate sequence forbidding multiples of 10, 101010110010001010011 replaces 222229999999292992929. - Ed Pegg Jr, Mar 05 2024
|
|
LINKS
|
|
|
EXAMPLE
|
a(2) = 16 = 2^4 is certainly the smallest number made of 2 distinct nonzero digits that has the least largest prime factor. 32 and 64 would have the same smoothness, but we list the smallest solution
a(3) = 144 = 2^4*3^2 is the least 3-digit number made of 2 distinct nonzero digits that has the least largest prime factor, here 3. (288 would have the same smoothness.)
a(4) = 3888 = 2^4*3^5 and 7776 = 2^5*3^5 are the smoothest 4-digit numbers made of 2 distinct nonzero digits.
For n = 7 digits, all of {1111222, 2222444, 3333666, 4444888, 5665556, 7777887} have the same minimum smoothness of 29.
Similarly, for n = 10, all of {4334433444, 4444994444, 8668866888, 8889988888} have the same minimum smoothness of 23 (and all of them also have prime factors 2, 11 and 19; the first and third are also divisible by 3^4, the two others have a second factor 19 and four factors 23).
|
|
PROG
|
(PARI) a(n)={my(s=oo, L); forvec(d=vector(2, i, [1, 9]), gcd(d)>1&&next; my(g, f(v) = fromdigits(vecextract(d, v))); forvec(v=vector(n, i, [1, 2]), if(s < g=A006530(f(v)), next, s == g, L=concat(L, f(v)), s=g, L=[f(v)])), 2); vecmin(L)}
(Python)
from sympy import factorint
from itertools import combinations
from sympy.utilities.iterables import multiset_permutations
def a(n):
m = (int('9'*n), )*2
for c in combinations("123456789", 2):
for r in multiset_permutations(c[0]*n+c[1]*n, n):
t = int("".join(r))
s = max(factorint(t, limit=m[0]))
m = min(m, (s, t))
return m[1]
|
|
CROSSREFS
|
Cf. A006530 (greatest prime factor), A101594 (zeroless numbers with exactly 2 distinct digits).
Cf. A370361 (greatest prime factor of the terms).
|
|
KEYWORD
|
nonn,base
|
|
AUTHOR
|
|
|
EXTENSIONS
|
|
|
STATUS
|
approved
|
|
|
|