login
A172502
Denominator of fraction whose decimal representation has form 0.(n)(n)(n)...with repeating part n.
4
9, 9, 3, 9, 9, 3, 9, 9, 1, 99, 9, 33, 99, 99, 33, 99, 99, 11, 99, 99, 33, 9, 99, 33, 99, 99, 11, 99, 99, 33, 99, 99, 3, 99, 99, 11, 99, 99, 33, 99, 99, 33, 99, 9, 11, 99, 99, 33, 99, 99, 33, 99, 99, 11, 9, 99, 33, 99, 99, 33, 99, 99, 11, 99, 99, 3, 99, 99, 33
OFFSET
1,1
COMMENTS
a(n) is a divisor of 10^(floor(1+log_10(n)))-1. - Robert G. Wilson v, Jul 04 2015
LINKS
FORMULA
a(n) = denominator of n/(10^floor(1+log_10(n))-1) in reduced terms. - Robert G. Wilson v, Jul 05 2015
EXAMPLE
a(10) = 99; 10 / 99 = 0.10101010... (repeating 10). a(9) = 1; 1 / 1 = 0.9999999...
MAPLE
a:= n-> denom(n*sum(10^(-i*length(n)), i=1..infinity)):
seq(a(n), n=1..100); # Alois P. Heinz, Jul 04 2015
MATHEMATICA
f[n_] := Block[{lg = 1 + Floor@ Log10@ n}, Denominator[n/(10^lg - 1)]]; Array[f, 70] (* Robert G. Wilson v, Jul 04 2015 *)
PROG
(Python)
from sympy import sympify
def A172502(n): return sympify('0.['+str(n)+']').q # Chai Wah Wu, Nov 12 2021
(PARI) a(n) = my(qd = #digits(n)); denominator(n / (10^(qd)-1)); \\ Michel Marcus, Jul 29 2023
CROSSREFS
Numerators are in A172500.
Sequence in context: A007471 A180012 A172504 * A118739 A192031 A283749
KEYWORD
nonn,base
AUTHOR
Jaroslav Krizek, Feb 05 2010
EXTENSIONS
Edited by Franklin T. Adams-Watters, Mar 28 2014
More terms from Alois P. Heinz, Jul 04 2015
STATUS
approved