A199238 n mod (number of ones in binary representation of n).
0, 0, 1, 0, 1, 0, 1, 0, 1, 0, 2, 0, 1, 2, 3, 0, 1, 0, 1, 0, 0, 1, 3, 0, 1, 2, 3, 1, 1, 2, 1, 0, 1, 0, 2, 0, 1, 2, 3, 0, 2, 0, 3, 2, 1, 2, 2, 0, 1, 2, 3, 1, 1, 2, 0, 2, 1, 2, 4, 0, 1, 2, 3, 0, 1, 0, 1, 0, 0, 1, 3, 0, 1, 2, 3, 1, 1, 2, 4, 0, 0, 1, 3, 0, 1, 2
Offset: 1
Keywords
Links
Programs
-
Haskell
a199238 n = a199238_list !! (n-1) a199238_list = zipWith mod [1..] $ tail a000120_list
-
Mathematica
Mod[#,DigitCount[#,2,1]]&/@Range[90] (* Harvey P. Dale, Nov 08 2011 *)
-
PARI
A199238(n)=n%norml2(binary(n)) \\ M. F. Hasler, Oct 09 2012
Comments