OFFSET
1,2
EXAMPLE
n=8; (8, 1) -> (9, 2) -> (11, 3) -> (14, 5) -> (19, 5) -> (24, 5) -> (29, 4) -> (33, 5) -> (38, 4) -> (42, 4) -> 46, 4) -> (50, 5). 50/5 = 10, so a(8) = 11 because it needs 11 iterations until p/q is an integer.
PROG
(PARI) f(v) = return([v[1]+v[2], hammingweight(v[1])+hammingweight(v[2])]);
a(n) = {my(nb = 0, v = [n, 1]); while (1, v = f(v); nb++; if (frac(v[1]/v[2]) == 0, return (nb))); } \\ Michel Marcus, Jan 13 2019
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Ctibor O. Zizka, Jan 12 2019
STATUS
approved