%I #29 Nov 12 2021 20:28:32
%S 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,
%T 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,
%U 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
%N 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... .
%C The fraction k(n) = a(2*n-1)/a(2*n) is already in lowest terms.
%e k(1) = a(1)/a(2) = 1/9 = 0.1111111... with the infinite period 1 = k;
%e k(2) = a(3)/a(4) = 2/9 = 0.2222222... with the infinite period 2 = k;
%e k(3) = a(5)/a(6) = 1/3 = 0.3333333... with the infinite period 3 = k;
%e ...
%e k(12) = a(23)/a(24) = 4/33 = 0.12121212... with the infinite period 12 = k;
%e k(13) = a(25)/a(26) = 13/99 = 0.13131313... with the infinite period 13 = k;
%e k(14) = a(27)/a(28) = 14/99 = 0.14141414... with the infinite period 14 = k;
%e etc.
%e Note that the infinite period 9 is given here by the fraction 1/1 as 1/1 = 0.9999999...
%e 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...
%t Flatten@Table[{Numerator@#,Denominator@#}&@FromDigits[{{IntegerDigits@k},0}],{k,48}] (* _Giorgos Kalogeropoulos_, Nov 03 2021 *)
%o (Python)
%o from sympy import sympify
%o 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
%Y Cf. A002487 (Stern-Brocot sequence), A172500, A172502.
%K base,nonn
%O 1,2
%A _Eric Angelini_ and _Carole Dubois_, Nov 02 2021
|