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.
%I A167489 #36 Apr 17 2017 09:01:49 %S A167489 1,1,1,2,2,1,2,3,3,2,1,2,4,2,3,4,4,3,2,4,2,1,2,3,6,4,2,4,6,3,4,5,5,4, %T A167489 3,6,4,2,4,6,3,2,1,2,4,2,3,4,8,6,4,8,4,2,4,6,9,6,3,6,8,4,5,6,6,5,4,8, %U A167489 6,3,6,9,6,4,2,4,8,4,6,8,4,3,2,4,2,1,2,3,6,4,2,4,6,3,4,5,10,8,6,12,8,4,8 %N A167489 Product of run lengths in binary representation of n. %H A167489 Antti Karttunen, <a href="/A167489/b167489.txt">Table of n, a(n) for n = 0..8192</a> %H A167489 <a href="/index/Bi#binary">Index entries for sequences related to binary expansion of n</a> %F A167489 a(n) = A227349(n) * A227350(n) = A227355(A227352(2n+1)). - _Antti Karttunen_, Jul 25 2013 %F A167489 a(n) = A284558(n) * A284559(n) = A284582(n) * A284583(n). - _Antti Karttunen_, Apr 16 2017 %e A167489 a(56) = 9, because 56 in binary is written 111000 giving the run lengths 3,3 and 3x3 = 9. %e A167489 a(99) = 12, because 99 in binary is written 1100011 giving the run lengths 2,3,2, and 2x3x2 = 12. %t A167489 Table[ Times @@ (Length /@ Split[IntegerDigits[n, 2]]), {n, 0, 100}](* _Olivier Gérard_, Jul 05 2013 *) %o A167489 (Scheme) %o A167489 (define (A167489 n) (apply * (binexp->runcount1list n))) %o A167489 (define (binexp->runcount1list n) (if (zero? n) (list) (let loop ((n n) (rc (list)) (count 0) (prev-bit (modulo n 2))) (if (zero? n) (cons count rc) (if (eq? (modulo n 2) prev-bit) (loop (floor->exact (/ n 2)) rc (1+ count) (modulo n 2)) (loop (floor->exact (/ n 2)) (cons count rc) 1 (modulo n 2))))))) %o A167489 ;; _Antti Karttunen_, Jul 05 2013 %o A167489 (Haskell) %o A167489 import Data.List (group) %o A167489 a167489 = product . map length . group . a030308_row %o A167489 -- _Reinhard Zumkeller_, Jul 05 2013 %o A167489 (Python) %o A167489 def A167489(n): %o A167489 '''Product of run lengths in binary representation of n.''' %o A167489 p = 1 %o A167489 b = n%2 %o A167489 i = 0 %o A167489 while (n != 0): %o A167489 n >>= 1 %o A167489 i += 1 %o A167489 if ((n%2) != b): %o A167489 p *= i %o A167489 i = 0 %o A167489 b = n%2 %o A167489 return(p) %o A167489 # _Antti Karttunen_, Jul 24 2013 (Cf. Python program for A227184). %o A167489 (PARI) a(n) = {my(p=1, b=n%2, i=0); while(n!=0, n=n>>1; i=i+1; if((n%2)!=b, p=p*i; i=0; b=n%2)); p} \\ _Indranil Ghosh_, Apr 17 2017, after the Python Program by _Antti Karttunen_ %Y A167489 Row products of A101211 and A227736 (for n > 0). %Y A167489 Cf. A167490 (smallest number with binary run length product = n). %Y A167489 Cf. A167491 (members of A167490 sorted in ascending order). %Y A167489 Cf. A227355, A227184, A227190. %Y A167489 Cf. A227349, A227350, A227352, A246588, A284558, A284559, A284582, A284583. %Y A167489 Differs from similar A284579 for the first time at n=56, where a(56) = 9, while A284579(56) = 5. %K A167489 nonn,base %O A167489 0,4 %A A167489 _Andrew Weimholt_, Nov 05 2009