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.

A348367 a(n) = w(n + w(n)), where w(n) is the binary weight of n, A000120(n).

This page as a plain text file.
%I A348367 #15 Oct 19 2021 10:59:48
%S A348367 1,2,2,2,3,1,2,2,3,2,3,3,1,2,3,2,3,2,3,3,2,3,4,3,3,4,5,5,2,2,2,2,3,2,
%T A348367 3,3,2,3,4,3,3,4,5,5,3,3,3,3,3,4,5,5,4,4,4,5,5,5,1,1,2,3,3,2,3,2,3,3,
%U A348367 2,3,4,3,3,4,5,5,3,3,3,3,3,4,5,5,4,4,4,5,5,5,2,2,3,4,4,3,3,4,5
%N A348367 a(n) = w(n + w(n)), where w(n) is the binary weight of n, A000120(n).
%F A348367 a(n) = A000120(n + A000120(n)); a(n) = A000120(A092391(n)).
%e A348367 n = 5; a(5) = A000120(5 + A000120(5)) = 3.
%t A348367 h[n_] := DigitCount[n, 2, 1]; a[n_] := h[n + h[n]]; Array[a, 100] (* _Amiram Eldar_, Oct 15 2021 *)
%o A348367 (Python)
%o A348367 def h(n): return bin(n).count('1')
%o A348367 def a(n): return h(n + h(n))
%o A348367 print([a(n) for n in range(1, 100)]) # _Michael S. Branicky_, Oct 15 2021
%o A348367 (PARI) a(n) = hammingweight(n + hammingweight(n)); \\ _Michel Marcus_, Oct 17 2021
%Y A348367 Cf. A000120, A092391.
%K A348367 nonn,base
%O A348367 1,2
%A A348367 _Ctibor O. Zizka_, Oct 15 2021