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 A377712 #22 Nov 07 2024 02:27:45 %S A377712 1,1,1,1,1,1,1,1,1,10,11,12,13,14,15,16,17,18,19,10,21,11,23,12,25,13, %T A377712 27,14,29,10,31,16,11,17,35,12,37,19,13,10,41,14,43,11,15,23,47,12,49, %U A377712 10,17,13,53,18,11,14,19,29,59,10,61,31,21,16,13,11,67 %N A377712 a(n) is the least divisor of n with as many decimal digits as n. %H A377712 Rémy Sigrist, <a href="/A377712/b377712.txt">Table of n, a(n) for n = 1..10000</a> %F A377712 1 <= n/a(n) <= 9. %e A377712 For n = 42: the divisors of 42 are 1, 2, 3, 6, 7, 14, 21, 42; the least divisor with 2 digits is 14, so a(42) = 14. %p A377712 f:= proc(n) local d,t; %p A377712 t:= ilog10(n); %p A377712 min(select(d -> ilog10(d)=t, numtheory:-divisors(n))) %p A377712 end proc: %p A377712 map(f, [$1..100]); # _Robert Israel_, Nov 06 2024 %t A377712 s={};Do[m=0;d=Divisors[n];Until[Length[IntegerDigits[d[[m]]]]==Length[IntegerDigits[n]],m++];AppendTo[s,d[[m]]],{n,67}];s (* _James C. McMahon_, Nov 06 2024 *) %o A377712 (PARI) a(n, base = 10) = { my (w = #digits(n, base)); forstep (x = base-1, 1, -1, if (n%x==0 && #digits(n/x)==w, return (n/x););); } %o A377712 (Python) %o A377712 def A377712(n): return n//next(d for d in range(n//10**(len(str(n))-1),0,-1) if not n%d) # _Chai Wah Wu_, Nov 06 2024 %Y A377712 Cf. A055642, A109940. %K A377712 nonn,base,easy %O A377712 1,10 %A A377712 _Rémy Sigrist_, Nov 04 2024