# Greetings from The On-Line Encyclopedia of Integer Sequences! http://oeis.org/ Search: id:a037834 Showing 1-1 of 1 %I A037834 #29 Jul 13 2024 20:42:14 %S A037834 0,1,0,1,2,1,0,1,2,3,2,1,2,1,0,1,2,3,2,3,4,3,2,1,2,3,2,1,2,1,0,1,2,3, %T A037834 2,3,4,3,2,3,4,5,4,3,4,3,2,1,2,3,2,3,4,3,2,1,2,3,2,1,2,1,0,1,2,3,2,3, %U A037834 4,3,2,3,4,5,4,3,4,3,2,3,4,5,4,5,6,5,4,3,4,5 %N A037834 a(n) = Sum_{i=1..m} |d(i) - d(i-1)|, where Sum_{i=0..m} d(i)*2^i is the base-2 representation of n. %C A037834 Number of i such that |d(i) - d(i-1)| = 1, where Sum_{i=0..m} d(i)*2^i is the base-2 representation of n. %H A037834 Reinhard Zumkeller, Table of n, a(n) for n = 1..10000 %H A037834 Paul Barry, Conjectures and results on some generalized Rueppel sequences, arXiv:2107.00442 [math.CO], 2021. %H A037834 Index entries for sequences related to binary expansion of n %p A037834 A037834 := proc(n) %p A037834 local dgs ; %p A037834 dgs := convert(n,base,2); %p A037834 add( abs(op(i,dgs)-op(i-1,dgs)),i=2..nops(dgs)) ; %p A037834 end proc: # _R. J. Mathar_, Oct 16 2015 %t A037834 Table[Total@ Flatten@ Map[Abs@ Differences@ # &, Partition[ IntegerDigits[n, 2], 2, 1]], {n, 90}] (* _Michael De Vlieger_, May 09 2017 *) %o A037834 (Haskell) %o A037834 a037834 n = sum $ map fromEnum $ zipWith (/=) (tail bs) bs %o A037834 where bs = a030308_row n %o A037834 -- _Reinhard Zumkeller_, Feb 20 2014 %o A037834 (Python) %o A037834 def A037834(n): return (n^(n>>1)).bit_count()-1 # _Chai Wah Wu_, Jul 13 2024 %Y A037834 A005811(n)-1. %Y A037834 Cf. A030308. %K A037834 nonn,base %O A037834 1,5 %A A037834 _Clark Kimberling_ # Content is available under The OEIS End-User License Agreement: http://oeis.org/LICENSE