OFFSET
1,2
EXAMPLE
8/1 -> 9/2 -> 11/3 -> 14/5 -> 19/5 -> 24/5 -> 29/4 -> 33/5 -> 38/4=19/2 -> 21/4 -> 25/4 -> 29/4 and the 5-cycle repeats, so a(8) = -1.
13/1 -> 14/4=7/2 -> 9/4 -> 13/3 -> 16/5 -> 21/3=7 so a(13) = 5.
MATHEMATICA
Array[If[AnyTrue[#, IntegerQ], 1 + LengthWhile[#, ! IntegerQ@ # &], -1] &@ Rest@ NestWhileList[(#1 + #2)/(DigitCount[#1, 2, 1] + DigitCount[#2, 2, 1]) & @@ {Numerator@ #, Denominator@ #} &, #, UnsameQ, All] &, 79] (* Michael De Vlieger, Jan 18 2019 *)
CROSSREFS
KEYWORD
sign
AUTHOR
Ctibor O. Zizka, Jan 18 2019
STATUS
approved