OFFSET
1,2
COMMENTS
LINKS
Rémy Sigrist, Table of n, a(n) for n = 1..9207
Eric Weisstein's World of Mathematics, Repeating Decimal
Eric Weisstein's World of Mathematics, Repdigit
PROG
(Python)
A125289_list = [n for n in range(10**4) if len(set(str(n))-{'0'})==1]
# Chai Wah Wu, Jan 04 2015
(PARI) is(n, base=10) = #Set(select(sign, digits(n, base)))==1 \\ Rémy Sigrist, Mar 28 2020
(PARI) a(n, base=10) = { for (w=0, oo, if (n<=(base-1)*2^w, my (d=1+(n-1)\2^w, k=2^w+(n-1)%(2^w)); return (d*fromdigits(binary(k), base)), n -= (base-1)*2^w)) } \\ Rémy Sigrist, Mar 28 2020
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Reinhard Zumkeller, Nov 26 2006
STATUS
approved