OFFSET
1,3
COMMENTS
A376241 uses the Stern-Brocot sequence s = A002487 to enumerate all (nonnegative) rational x = s(n)/s(n+1) and similarly y = s(m)/s(m+1), WLOG m <= n, which yield an integer x*y*z = x+y+z with (necessarily) z = (x+y)/(xy-1). The present sequence lists the m-values corresponding to the n-values listed in A376241.
EXAMPLE
m | x | y | z | xyz = x+y+z
-----+-----+-----+-----+------------
0 | 0 | 0 | 0 | 0
1 | 2 | 1 | 3 | 6
2 | 3/2 | 1/2 | -8 | -6
1 | 3 | 1 | 2 | 6
6 | 4/3 | 2/3 | -18 | -16
2 | 5/2 | 1/2 | 12 | 15
2 | 4 | 1/2 | 9/2 | 9
14 | 5/4 | 3/4 | -32 | -30
...| ... | ... | ... | ...
PROG
(PARI) A376242(n, k=A376241(n))={my(p, q=1, x=A002487(k)/A002487(k+1)); for(m=2, k, my(y=(p=q)/q=A002487(m)); x*y != 1 && denominator(x+y+(x+y)/(x*y-1))==1 && return(m-1))} \\ Short of a function A376241(n), one can simply provide a term k = A376241(n) as second argument and omit the first argument n.
CROSSREFS
KEYWORD
nonn
AUTHOR
M. F. Hasler, Sep 16 2024
STATUS
approved