|
|
A078257
|
|
a(n) = denominator(N) where N = 0.123...n (concatenation of 1 to n after decimal point).
|
|
6
|
|
|
10, 25, 1000, 5000, 20000, 15625, 10000000, 50000000, 1000000000, 10000000000, 10000000000000, 125000000000000, 100000000000000000, 5000000000000000000, 200000000000000000000, 25000000000000000000000, 10000000000000000000000000, 500000000000000000000000000, 100000000000000000000000000000
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
1,1
|
|
COMMENTS
|
|
|
LINKS
|
|
|
FORMULA
|
|
|
EXAMPLE
|
a(1) = 10 as 10*0.1 = 1, a(2) = 25 as 25*0.12 = 3.
|
|
PROG
|
(PARI) a(n) = {my(s = ""); for (k=1, n, s = concat(s, Str(k))); denominator(eval(s)/10^(#s)); } \\ Michel Marcus, Jan 15 2019
(Python)
from itertools import count, islice
def agen(): # generator of terms
num, den, pow = 0, 1, 0
for n in count(1):
sn = str(n)
num = num*10**len(sn) + n
den *= 10**len(sn)
pow += len(sn)
nr, dr, c2, c5 = num, den, pow, pow
while nr%2 == 0 and c2 > 0: nr //= 2; dr //= 2; c2 -= 1
while nr%5 == 0 and c5 > 0: nr //= 5; dr //= 5; c5 -= 1
yield dr
|
|
CROSSREFS
|
|
|
KEYWORD
|
base,nonn,frac
|
|
AUTHOR
|
|
|
EXTENSIONS
|
|
|
STATUS
|
approved
|
|
|
|