login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A333861 The sum of the Hamming weights of the elements of the Collatz orbit of n. 2
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, 19, 527, 41, 42, 47, 507, 6, 66, 26, 28, 47, 50, 52, 100, 13, 520, 13, 73, 35, 34, 39, 497, 19, 59, 61, 66, 22, 21, 531, 537, 44, 85, 46, 91, 51, 52, 512, 523, 7, 67 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,2
LINKS
FORMULA
a(n) = Sum_{k=1..A008908(n)} A000120(A070165(n,k)). - Alois P. Heinz, Apr 10 2020
EXAMPLE
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.
MATHEMATICA
a[n_] := Total[DigitCount[#, 2, 1] & /@ NestWhileList[If[OddQ[#], 3*# + 1, #/2] &, n, # > 1 &]]; Array[a, 65] (* Amiram Eldar, Jul 29 2023 *)
PROG
(PARI) a(n) = {
my(c = hammingweight(n));
while(n>1, n = if(n%2 == 0, n/2, 3*n+1); c += hammingweight(n));
c;
}
CROSSREFS
Sequence in context: A342043 A351997 A104662 * A338845 A121713 A357820
KEYWORD
nonn,base,easy,look
AUTHOR
Markus Sigg, Apr 08 2020
STATUS
approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 25 07:07 EDT 2024. Contains 371964 sequences. (Running on oeis4.)