cp's OEIS Frontend

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.

A266161 Hamming weights of A266089.

This page as a plain text file.
%I A266161 #8 Jul 18 2023 02:29:18
%S A266161 0,1,2,1,2,1,2,3,2,1,2,3,2,3,4,3,2,1,2,3,2,3,4,3,2,3,4,3,4,3,4,5,4,3,
%T A266161 2,1,2,3,2,3,2,3,4,3,4,3,4,5,4,3,2,3,4,3,4,5,4,3,4,5,4,5,6,5,4,3,2,1,
%U A266161 2,3,2,3,2,3,4,3,4,3,4,5,4,3,2,3,4,3
%N A266161 Hamming weights of A266089.
%H A266161 Reinhard Zumkeller, <a href="/A266161/b266161.txt">Table of n, a(n) for n = 0..10000</a>
%F A266161 a(n) = A000120(A266089(n)).
%F A266161 abs(a(n+1) - a(n)) = 1 by definition of A266089.
%F A266161 For n > 0: a(A140253(n)) = n and a(m) < n for m < A140253(n).
%t A266161 s[0] = 0; s[n_] := s[n] = Module[{bw = DigitCount[s[n - 1], 2, 1], k = 1}, While[!FreeQ[Array[s, n - 1], k] || Abs[DigitCount[k, 2, 1] - bw] != 1, k++]; k]; DigitCount[Array[s, 100, 0], 2, 1] (* _Amiram Eldar_, Jul 18 2023 *)
%o A266161 (Haskell)
%o A266161 a266161 = a000120 . a266089
%Y A266161 Cf. A000120, A140253, A266089.
%K A266161 nonn,base
%O A266161 0,3
%A A266161 _Reinhard Zumkeller_, Dec 22 2015