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.

A255070 (1/2)*(n minus number of runs in the binary expansion of n): a(n) = (n - A005811(n)) / 2 = A236840(n)/2.

Original entry on oeis.org

0, 0, 0, 1, 1, 1, 2, 3, 3, 3, 3, 4, 5, 5, 6, 7, 7, 7, 7, 8, 8, 8, 9, 10, 11, 11, 11, 12, 13, 13, 14, 15, 15, 15, 15, 16, 16, 16, 17, 18, 18, 18, 18, 19, 20, 20, 21, 22, 23, 23, 23, 24, 24, 24, 25, 26, 27, 27, 27, 28, 29, 29, 30, 31, 31, 31, 31, 32, 32, 32, 33, 34, 34, 34, 34, 35
Offset: 0

Views

Author

Antti Karttunen, Feb 14 2015

Keywords

Crossrefs

Least inverse: A091067 (also the positions of records).
Greatest inverse: A255068.
Run lengths: A106836.

Programs

  • Mathematica
    a[n_] := (n - Length@ Split[IntegerDigits[n, 2]])/2; a[0] = 0; Array[a, 100, 0] (* Amiram Eldar, Jul 16 2023 *)
  • Scheme
    (define (A255070 n) (/ (A236840 n) 2))

Formula

a(n) = A236840(n) / 2 = (n - A005811(n)) / 2.
Other identities:
a(A091067(n)) = n for all n >= 1.
a(A255068(n)) = n for all n >= 0.
a(A269363(n)) = A269367(n). - Antti Karttunen, Aug 12 2019