cp's OEIS Frontend

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.

A227190 a(n) = n minus (product of run lengths in binary representation of n).

Original entry on oeis.org

0, 1, 1, 2, 4, 4, 4, 5, 7, 9, 9, 8, 11, 11, 11, 12, 14, 16, 15, 18, 20, 20, 20, 18, 21, 24, 23, 22, 26, 26, 26, 27, 29, 31, 29, 32, 35, 34, 33, 37, 39, 41, 41, 40, 43, 43, 43, 40, 43, 46, 43, 48, 51, 50, 49, 47, 51, 55, 53, 52, 57, 57, 57, 58, 60, 62, 59, 62
Offset: 1

Views

Author

Antti Karttunen, Jul 04 2013

Keywords

Examples

			For 8, "1000" in binary, the run lengths are 1 and 3, 1*3=3, and 8-3 = 5, thus a(8)=5. For 24, "11000" in binary, the run lengths are 2 and 3, 2*3=6, and 24-6 = 18, thus a(24)=18.
		

Crossrefs

Programs

  • Haskell
    a227190 n = n - a167489 n  -- Reinhard Zumkeller, Jul 05 2013
  • Mathematica
    Table[n-Times@@(Length/@Split[IntegerDigits[n,2]]),{n,70}] (* Harvey P. Dale, Aug 02 2013 *)
  • Scheme
    (define (A227190 n) (- n (A167489 n))) ;; The Scheme-program for A167489 is found under that entry.
    

Formula

a(n) = n - A167489(n).