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.

Showing 1-4 of 4 results.

A236840 n minus number of runs in the binary expansion of n: a(n) = n - A005811(n).

Original entry on oeis.org

0, 0, 0, 2, 2, 2, 4, 6, 6, 6, 6, 8, 10, 10, 12, 14, 14, 14, 14, 16, 16, 16, 18, 20, 22, 22, 22, 24, 26, 26, 28, 30, 30, 30, 30, 32, 32, 32, 34, 36, 36, 36, 36, 38, 40, 40, 42, 44, 46, 46, 46, 48, 48, 48, 50, 52, 54, 54, 54, 56, 58, 58, 60, 62, 62, 62, 62, 64, 64, 64
Offset: 0

Views

Author

Antti Karttunen, Apr 18 2014

Keywords

Comments

All terms are even. Used by the "number-of-runs beanstalk" sequence A255056 and many of its associated sequences.

Crossrefs

Cf. A091067 (the positions of records), A106836 (run lengths).
Cf. A255070 (terms divided by 2).

Programs

  • Maple
    A236840 := proc(n) local i, b; if n=0 then 0 else b := convert(n, base, 2); select(i -> (b[i-1]<>b[i]), [$2..nops(b)]); n-1-nops(%) fi end: seq(A236840(i), i=0..69); # Peter Luschny, Apr 19 2014
  • Mathematica
    a[n_] := n - Length@ Split[IntegerDigits[n, 2]]; a[0] = 0; Array[a, 100, 0] (* Amiram Eldar, Jul 16 2023 *)
  • Scheme
    (define (A236840 n)  (- n (A005811 n)))

Formula

a(n) = n - A005811(n) = n - A000120(A003188(n)).
a(n) = 2*A255070(n).

A227153 Product of nonzero digits of n in factorial base.

Original entry on oeis.org

1, 1, 1, 1, 2, 2, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 4, 4, 3, 3, 3, 3, 6, 6, 1, 1, 1, 1, 2, 2, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 4, 4, 3, 3, 3, 3, 6, 6, 2, 2, 2, 2, 4, 4, 2, 2, 2, 2, 4, 4, 4, 4, 4, 4, 8, 8, 6, 6, 6, 6, 12, 12, 3, 3, 3, 3, 6, 6, 3, 3, 3, 3, 6, 6, 6, 6, 6, 6
Offset: 0

Views

Author

Antti Karttunen, Jul 04 2013

Keywords

Comments

a(0) = 1 as an empty product always gives 1.

Crossrefs

A227157 gives the positions where equal with A208575.

Programs

  • Mathematica
    a[n_] := Module[{k = n, m = 2, r, p = 1}, While[{k, r} = QuotientRemainder[k, m]; k != 0|| r != 0, If[r > 0, p *= r]; m++]; p]; Array[a, 100, 0] (* Amiram Eldar, Feb 07 2024 *)
  • Python
    from functools import reduce
    from operator import mul
    def A(n, p=2):
        return n if n
  • Python
    def a(n, k=2): return max(n % k, 1) * a(n // k, k + 1) if n else 1 # David Radcliffe, May 22 2025

Formula

For all n, a(A227157(n)) = A208575(A227157(n)).

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).

A237449 a(n) = n - A236855(n).

Original entry on oeis.org

0, 0, 1, 1, 1, 4, 4, 5, 5, 5, 7, 7, 7, 7, 13, 13, 14, 14, 14, 17, 17, 18, 18, 18, 20, 20, 20, 20, 25, 25, 26, 26, 26, 28, 28, 28, 28, 31, 31, 31, 31, 31, 41, 41, 42, 42, 42, 45, 45, 46, 46, 46, 48, 48, 48, 48, 54, 54, 55, 55, 55, 58, 58, 59, 59, 59, 61, 61, 61, 61
Offset: 0

Views

Author

Antti Karttunen, Apr 18 2014

Keywords

Crossrefs

Programs

  • Mathematica
    A236855list[m_] := With[{r = 2*Range[2, m]-1}, Reverse[Map[Total[r-#] &, Select[Subsets[Range[2, 2*m-1], {m-1}], Min[r-#] >= 0 &]]]];
    With[{m = 6}, Range[0, CatalanNumber[m]-1] - A236855list[m]] (* Generates C(m) terms *) (* Paolo Xausa, Feb 20 2024 *)
  • Scheme
    (define (A237449 n) (- n (A236855 n)))

Formula

a(n) = n - A236855(n).
Showing 1-4 of 4 results.