|
|
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
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
1,1
|
|
COMMENTS
|
|
|
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)):
|
|
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
(PARI) a(n) = my(qd = #digits(n)); denominator(n / (10^(qd)-1)); \\ Michel Marcus, Jul 29 2023
|
|
CROSSREFS
|
|
|
KEYWORD
|
nonn,base
|
|
AUTHOR
|
|
|
EXTENSIONS
|
|
|
STATUS
|
approved
|
|
|
|