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 A244859 #36 Mar 06 2025 11:11:15 %S A244859 0,1,10,111,100,10,1110,111111,1000,111111111,10,11,11100,111111, %T A244859 1111110,1110,10000,1111111111111111,1111111110,111111111111111111, %U A244859 100,111111,110,1111111111111111111111,111000,100,1111110,111111111111111111111111111,11111100 %N A244859 Least positive multiple of n which when written in base 10 is either a repunit or of the form 111...000. %C A244859 a(1017) has 1008 digits. - _Michael S. Branicky_, Feb 22 2024 %C A244859 a(0) = 0 by convention: It can be considered as a repunit with zero digits, A002275(0) = (10^0-1)/9, and it is a positive multiple of n in the sense of k*n with k > 0. - _M. F. Hasler_, Mar 04 2025 %H A244859 Michael S. Branicky, <a href="/A244859/b244859.txt">Table of n, a(n) for n = 0..1016</a> (terms 101..936 from Robert Israel, terms 0..100 from Chai Wah Wu). %H A244859 Chai Wah Wu, <a href="http://www.jstor.org/stable/10.4169/amer.math.monthly.121.06.529">Pigeonholes and repunits</a>, Amer. Math. Monthly, 121 (2014), 529-533. %F A244859 a(n) = n*A244927(n). - _M. F. Hasler_, Mar 04 2025 %F A244859 a(3^k) = (10^(3^k)-1)/9. For n > 0, A055642(a(n)) <= n. If n > 2 is not a power of 3, then A055642(a(n)) < n. - _Chai Wah Wu_, Mar 04 2025 %p A244859 A244859:= proc(n) local m,d2,d5; %p A244859 d2:= padic:-ordp(n,2); %p A244859 d5:= padic:-ordp(n,5); %p A244859 m:= n/2^d2/5^d5; %p A244859 10^max(d2,d5)*(10^numtheory:-order(10,9*m)-1)/9 %p A244859 end proc: %p A244859 A244859(0):= 0: %p A244859 seq(A244859(n),n= 0..100); # _Robert Israel_, Jul 08 2014 %o A244859 (Python) %o A244859 def a(n): %o A244859 if n == 0: return 0 %o A244859 moddict = {0: 0} %o A244859 for e in range(1, n+2): %o A244859 repe = (10**e-1)//9 %o A244859 r = repe%n %o A244859 if r in moddict: %o A244859 return repe - moddict[r] %o A244859 else: %o A244859 moddict[r] = repe %o A244859 print([a(n) for n in range(29)]) # _Michael S. Branicky_, Feb 22 2024 %o A244859 (PARI) apply( {A244859(n, m=Map(Mat([0,0])))=for(L=1,n, my(r=10^L\9); iferr(return(r-mapget(m,r%n)), E, mapput(m, r%n, r)))}, [0..33]) \\ _M. F. Hasler_, Mar 04 2025 %Y A244859 Equal to A004290 for n = 1 .. 6. %Y A244859 Cf. A002275, A244927. %K A244859 nonn,base %O A244859 0,3 %A A244859 _Chai Wah Wu_, Jul 07 2014