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.

A333861 The sum of the Hamming weights of the elements of the Collatz orbit of n.

This page as a plain text file.
%I A333861 #46 Jul 21 2025 17:48:27
%S A333861 1,2,11,3,7,13,35,4,43,9,29,15,16,38,43,5,24,45,49,11,10,32,35,17,58,
%T A333861 19,527,41,42,47,507,6,66,26,28,47,50,52,100,13,520,13,73,35,34,39,
%U A333861 497,19,59,61,66,22,21,531,537,44,85,46,91,51,52,512,523,7,67
%N A333861 The sum of the Hamming weights of the elements of the Collatz orbit of n.
%H A333861 Markus Sigg, <a href="/A333861/b333861.txt">Table of n, a(n) for n = 1..10000</a>
%F A333861 a(n) = Sum_{k=1..A008908(n)} A000120(A070165(n,k)). - _Alois P. Heinz_, Apr 10 2020
%F A333861 a(n) = a(A006370(n)) + A000120(n), with a(1) = 1. - _Alan Michael Gómez Calderón_, Jul 15 2025
%e A333861 The Collatz orbit of 3 is 3,10,5,16,8,4,2,1. The Hamming weights are 2,2,2,1,1,1,1,1. The sum is a(3) = 11.
%t A333861 a[n_] := Total[DigitCount[#, 2, 1] & /@ NestWhileList[If[OddQ[#], 3*# + 1, #/2] &, n, # > 1 &]]; Array[a, 65] (* _Amiram Eldar_, Jul 29 2023 *)
%o A333861 (PARI) a(n) = my(c = hammingweight(n)); while(n>1, n = if(n%2 == 0, n/2, 3*n+1); c += hammingweight(n)); c;
%Y A333861 Cf. A000120, A006370, A008908, A070165, A333860.
%K A333861 nonn,base,easy,look
%O A333861 1,2
%A A333861 _Markus Sigg_, Apr 08 2020