A230300 a(n) = n + wt(n-1), where wt() = A000120() is the binary weight.
1, 3, 4, 6, 6, 8, 9, 11, 10, 12, 13, 15, 15, 17, 18, 20, 18, 20, 21, 23, 23, 25, 26, 28, 27, 29, 30, 32, 32, 34, 35, 37, 34, 36, 37, 39, 39, 41, 42, 44, 43, 45, 46, 48, 48, 50, 51, 53, 51, 53, 54, 56, 56, 58, 59, 61, 60, 62, 63, 65, 65, 67, 68, 70, 66, 68, 69, 71, 71, 73, 74, 76, 75, 77, 78, 80, 80, 82, 83, 85, 83, 85
Offset: 1
Programs
-
Maple
a:= n-> n+add(i,i=Bits[Split](n-1)): seq(a(n), n=1..82); # Alois P. Heinz, Jul 05 2024
-
Mathematica
Table[n+Total[IntegerDigits[n-1,2]],{n,100}] (* Harvey P. Dale, May 20 2015 *)
-
PARI
a(n) = n + hammingweight(n-1); \\ Michel Marcus, Jul 05 2024
Comments