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 A376615 #7 Sep 30 2024 12:49:40 %S A376615 0,0,1,0,1,2,1,0,1,2,1,3,1,1,1,0,1,2,1,3,2,1,1,4,1,1,1,1,1,1,1,0,1,2, %T A376615 1,3,1,1,1,4,1,2,1,1,1,1,1,5,1,1,1,1,1,1,2,1,1,1,1,2,1,1,1,0,1,2,1,3, %U A376615 2,1,1,4,1,1,1,1,1,1,1,5,2,1,1,2,1,1,1,1,1,1,1,2,1,1,1,6,1,1,1,1,1,1,1,1,1 %N A376615 a(n) is the number of iterations that n requires to reach a noninteger under the map x -> x / wt(x), where wt(k) is the binary weight of k (A000120); a(n) = 0 if n is a power of 2. %C A376615 The powers of 2 are fixed points of the map, since wt(2^k) = 1 for all k >= 0. Therefore they are arbitrarily assigned the value a(2^k) = 0. %C A376615 Each number n starts a chain of a(n) integers: n, n/wt(n), (n/wt(n))/wt(n/wt(n)), ..., of them the first a(n)-1 integers are binary Niven numbers (A049445). %H A376615 Amiram Eldar, <a href="/A376615/b376615.txt">Table of n, a(n) for n = 1..10000</a> %F A376615 a(n) = 0 if and only if n is in A000079 (by definition). %F A376615 a(n) = 1 if and only if n is in A065878. %F A376615 a(n) >= 2 if and only if n is in A049445 \ A000079 (i.e., n is a binary Niven number that is not a power of 2). %F A376615 a(n) >= 3 if and only if n is in A376616 \ A000079. %F A376615 a(n) >= 4 if and only if n is in A376617 \ A000079. %F A376615 a(2*n) >= a(n). %F A376615 a(3*2^n) = n+1 for n >= 0. %F A376615 a(n) < A000005(n). %e A376615 a(6) = 2 since 6/wt(6) = 3 and 3/wt(3) = 3/2 is a noninteger that is reached after 2 iterations. %e A376615 a(20) = 3 since 20/wt(20) = 10, 10/wt(10) = 5 and 5/wt(5) = 5/2 is a noninteger that is reached after 3 iterations. %t A376615 a[n_] := a[n] = Module[{bw = DigitCount[n, 2, 1]}, If[bw == 1, 0, If[!Divisible[n, bw], 1, 1 + a[n/bw]]]]; Array[a, 100] %o A376615 (PARI) a(n) = {my(w = hammingweight(n)); if(w == 1, 0, if(n % w, 1, 1 + a(n/w)));} %Y A376615 Cf. A000005, A000079, A000120, A049445, A065878, A376616, A376617, A376619. %K A376615 nonn,easy,base %O A376615 1,6 %A A376615 _Amiram Eldar_, Sep 30 2024