OFFSET
0,3
COMMENTS
a(1017) has 1008 digits. - Michael S. Branicky, Feb 22 2024
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
LINKS
Michael S. Branicky, Table of n, a(n) for n = 0..1016 (terms 101..936 from Robert Israel, terms 0..100 from Chai Wah Wu).
Chai Wah Wu, Pigeonholes and repunits, Amer. Math. Monthly, 121 (2014), 529-533.
FORMULA
a(n) = n*A244927(n). - M. F. Hasler, Mar 04 2025
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
MAPLE
A244859:= proc(n) local m, d2, d5;
d2:= padic:-ordp(n, 2);
d5:= padic:-ordp(n, 5);
m:= n/2^d2/5^d5;
10^max(d2, d5)*(10^numtheory:-order(10, 9*m)-1)/9
end proc:
A244859(0):= 0:
seq(A244859(n), n= 0..100); # Robert Israel, Jul 08 2014
PROG
(Python)
def a(n):
if n == 0: return 0
moddict = {0: 0}
for e in range(1, n+2):
repe = (10**e-1)//9
r = repe%n
if r in moddict:
return repe - moddict[r]
else:
moddict[r] = repe
print([a(n) for n in range(29)]) # Michael S. Branicky, Feb 22 2024
(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
CROSSREFS
KEYWORD
nonn,base,changed
AUTHOR
Chai Wah Wu, Jul 07 2014
STATUS
approved