login
A348870
Interleave A172500 and A172502: The resulting sequence has the property that the fraction k(n) := a(2*n-1)/a(2*n) has decimal expansion 0.nnnnnn... .
1
1, 9, 2, 9, 1, 3, 4, 9, 5, 9, 2, 3, 7, 9, 8, 9, 1, 1, 10, 99, 1, 9, 4, 33, 13, 99, 14, 99, 5, 33, 16, 99, 17, 99, 2, 11, 19, 99, 20, 99, 7, 33, 2, 9, 23, 99, 8, 33, 25, 99, 26, 99, 3, 11, 28, 99, 29, 99, 10, 33, 31, 99, 32, 99, 1, 3, 34, 99, 35, 99, 4, 11, 37, 99, 38, 99, 13, 33, 40, 99, 41, 99, 14, 33, 43, 99, 4, 9, 5, 11, 46, 99, 47, 99, 16, 33
OFFSET
1,2
COMMENTS
The fraction k(n) = a(2*n-1)/a(2*n) is already in lowest terms.
EXAMPLE
k(1) = a(1)/a(2) = 1/9 = 0.1111111... with the infinite period 1 = k;
k(2) = a(3)/a(4) = 2/9 = 0.2222222... with the infinite period 2 = k;
k(3) = a(5)/a(6) = 1/3 = 0.3333333... with the infinite period 3 = k;
...
k(12) = a(23)/a(24) = 4/33 = 0.12121212... with the infinite period 12 = k;
k(13) = a(25)/a(26) = 13/99 = 0.13131313... with the infinite period 13 = k;
k(14) = a(27)/a(28) = 14/99 = 0.14141414... with the infinite period 14 = k;
etc.
Note that the infinite period 9 is given here by the fraction 1/1 as 1/1 = 0.9999999...
Note also that periods like 11, or 222, or 3333... are respectively given by the fractions 1/9, 2/9, 1/3... already used for the periods 1, 2, 3...
MATHEMATICA
Flatten@Table[{Numerator@#, Denominator@#}&@FromDigits[{{IntegerDigits@k}, 0}], {k, 48}] (* Giorgos Kalogeropoulos, Nov 03 2021 *)
PROG
(Python)
from sympy import sympify
def A348870(n): return (lambda m, r: r.p if m % 2 else r.q)(n, sympify('0.['+str((n+1)//2)+']')) # Chai Wah Wu, Nov 12 2021
CROSSREFS
Cf. A002487 (Stern-Brocot sequence), A172500, A172502.
Sequence in context: A157215 A021919 A078127 * A217626 A275362 A217174
KEYWORD
base,nonn
AUTHOR
Eric Angelini and Carole Dubois, Nov 02 2021
STATUS
approved