This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.
%I A366165 #24 Oct 07 2023 11:22:14 %S A366165 1,1,1,1,10,1,3,1,5,3,1,6,1,7,1,2,2,1,4,7,5,1,1,3,2,1,1,1,1,2,1,1,10, %T A366165 4,3,3,10,1,2,3,1,1,1,7,1,1 %N A366165 a(n) is the least k > 0 such that 10^(2*n-1) - k can be written as a product j*m, where j and m have an equal number of decimal digits. %C A366165 a(n) <= 10 since 10^(2n-1)-10 = (10^(n-1)+1)(10^n-10). A consequence is that j and m in the product both have n decimal digits. - _Chai Wah Wu_, Oct 05 2023 %e A366165 n a(n) 10^(2n-1)-a(n) j m %e A366165 1 1 9 1 9 %e A366165 2 1 999 27 37 %e A366165 3 1 99999 123 813 %e A366165 4 1 9999999 2151 4649 %e A366165 5 10 999999990 10001 99990 %e A366165 6 1 99999999999 194841 513239 %e A366165 7 3 9999999999997 2769823 3610339 %e A366165 More than one pair (j,m) may exist, e.g., 9 = 1*9 = 3*3. %o A366165 (PARI) a366165(n)={my (p10=10^(2*n-1)); for (dd=1, p10, my (d=p10-dd); fordiv (d, x, fordiv (d, y, if (x*y==d && #digits(x)==#digits(y), return(dd)))))}; %o A366165 (Python) %o A366165 from itertools import count, takewhile %o A366165 from sympy import divisors %o A366165 def A366165(n): %o A366165 a, l1, l2 = 10**((n<<1)-1), 10**(n-1), 10**n %o A366165 for k in count(1): %o A366165 b = a-k %o A366165 if any(l1<=d<l2 and d*l2>b for d in takewhile(lambda m:m*m<=b, divisors(b))): %o A366165 return k # _Chai Wah Wu_, Oct 05 2023 %Y A366165 Cf. A002275, A003020, A004022, A057951, A327435. %Y A366165 A067272 are the solutions for even exponents of 10, corresponding to (j,m) = (9,9), (99,99), (999,999), ... . %K A366165 nonn,base,more %O A366165 1,5 %A A366165 _Hugo Pfoertner_, Oct 04 2023 %E A366165 a(33)-a(35) from _Chai Wah Wu_, Oct 05 2023 %E A366165 a(36)-a(46) from _Chai Wah Wu_, Oct 07 2023