This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.
%I A323375 #26 Dec 15 2024 08:00:21 %S A323375 1,3,3,3,1,2,1,11,4,10,1,3,4,9,2,19,1,18,1,1,7,17,7,7,6,5,6,6,1,4,15, %T A323375 5,16,4,1,2,4,3,1,14,3,13,13,13,12,12,1,6,12,2,5,5,11,1,5,13,10,4,1, %U A323375 12,3,9,3,3,1,2,1,1,40,2,8,8,39,3,7,7,9,2,3,1,3,37,37,37,5,36,36,3,1,8 %N A323375 Let f(p, q) denote the pair (p + q, wt(p) + wt(q)). a(n) gives the number of iterations of f starting at (n, 1) needed to make p/q an integer, or if no integer is ever reached then a(n) = -1. (Here wt is binary weight, A000120.) %e A323375 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. %o A323375 (PARI) f(v) = return([v[1]+v[2], hammingweight(v[1])+hammingweight(v[2])]); %o A323375 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 %Y A323375 Cf. A323275, A000120. %K A323375 nonn,base %O A323375 1,2 %A A323375 _Ctibor O. Zizka_, Jan 12 2019