%I #5 Jan 12 2023 23:01:27
%S 1,2,3,4,7,11,18,20,31,51,69,120,189,258,327,358,685,1043,1112,2155,
%T 2513,4668,7181,9694,12207,14720,17233,19746,22259,23371,45630,65376,
%U 88747,134377,223124,311871,400618,465994,554741,955359,1510100,2465459,3975559
%N Viggo Brun's ternary continued fraction algorithm applied to { log 2, log 3/2, log 5/4 } produces a list of triples (p,q,r); sequence gives q values.
%D V. Brun, Music and ternary continued fractions, Kgl. Norske Videnskabers Selskab Forh., 23 (No. 10, 1950).
%H J. M. Barbour, <a href="http://www.jstor.org/stable/2304456">Music and Ternary Continued Fractions</a>, The American Mathematical Monthly, Vol. 55, No. 9 (Nov., 1948), pp. 545-555.
%H Viggo Brun, <a href="/A060986/a060986.pdf">Music and ternary continued fractions</a>, Kgl. Norske Videnskabers Selskab Forh., 23 (No. 10, 1950), pages 38-40. [Annotated scanned copy]
%H V. Brun, <a href="http://www.jstor.org/stable/24524581">Musikk og Euklidske algoritmer</a> (in Danish), Nordisk Mat. Tidskr, 9 (1961), 29-36.
%H J. B. Rosser, <a href="http://www.jstor.org/stable/2307936">Generalized Ternary Continued Fractions</a>, The American Mathematical Monthly, Vol. 57, No. 8 (Oct., 1950), pp. 528-535.
%p Digits := 100 :
%p c := evalf(log[10](5/4)) :
%p b := evalf(log[10](3/2)) :
%p a := evalf(log[10](2)) :
%p a3 := [1,0,0] :
%p b3 := [0,1,0] :
%p c3 := [0,0,1] :
%p for i from 1 to 30 do
%p a := a-b ;
%p b3 := [op(1,a3)+op(1,b3), op(2,a3)+op(2,b3), op(3,a3)+op(3,b3)] ;
%p if i > 2 then
%p printf("%d, ",b3[2]) ;
%p end if;
%p if a < b then
%p tmp := a ;
%p a := b;
%p b := tmp;
%p tmp3 := a3 ;
%p a3 := b3;
%p b3 := tmp3;
%p end if;
%p if b < c then
%p tmp3 := b ;
%p b := c;
%p c := tmp;
%p tmp3 := b3 ;
%p b3 := c3;
%p c3 := tmp3;
%p end if;
%p end do: # _R. J. Mathar_, Feb 25 2018
%Y See A359742 for p values, A359744 for r values.
%K nonn,easy
%O 0,2
%A _Sean A. Irvine_, Jan 12 2023