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

A236855 a(n) is the sum of digits in A239903(n).

Original entry on oeis.org

0, 1, 1, 2, 3, 1, 2, 2, 3, 4, 3, 4, 5, 6, 1, 2, 2, 3, 4, 2, 3, 3, 4, 5, 4, 5, 6, 7, 3, 4, 4, 5, 6, 5, 6, 7, 8, 6, 7, 8, 9, 10, 1, 2, 2, 3, 4, 2, 3, 3, 4, 5, 4, 5, 6, 7, 2, 3, 3, 4, 5, 3, 4, 4, 5, 6, 5, 6, 7, 8, 4, 5, 5, 6, 7, 6, 7, 8, 9, 7, 8, 9, 10, 11, 3, 4
Offset: 0

Views

Author

Antti Karttunen, Apr 18 2014

Keywords

Examples

			As the 0th Catalan String is empty, indicated by A239903(0)=0, a(0)=0.
As the 18th Catalan String is [1,0,1,2] (A239903(18)=1012), a(18) = 1+0+1+2 = 4.
Note that although the range of validity of A239903 is inherently limited by the decimal representation employed, it doesn't matter here: We have a(58785) = 55, as the corresponding 58785th Catalan String is [1,2,3,4,5,6,7,8,9,10], even though A239903 cannot represent that unambiguously.
		

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 &]]]];
    A236855list[6] (* Generates C(6) terms *) (* Paolo Xausa, Feb 19 2024 *)
  • Scheme
    (define (A236855 n) (apply + (A239903raw n)))
    (define (A239903raw n) (if (zero? n) (list) (let loop ((n n) (row (- (A081288 n) 1)) (col (- (A081288 n) 2)) (srow (- (A081288 n) 2)) (catstring (list 0))) (cond ((or (zero? row) (negative? col)) (reverse! (cdr catstring))) ((> (A009766tr row col) n) (loop n srow (- col 1) (- srow 1) (cons 0 catstring))) (else (loop (- n (A009766tr row col)) (+ row 1) col srow (cons (+ 1 (car catstring)) (cdr catstring))))))))
    ;; Alternative definition:
    (define (A236855 n) (let ((x (A071155 (A081291 n)))) (- (A034968 x) (A060130 x))))

Formula

a(n) = A034968(x) - A060130(x), where x = A071155(A081291(n)).
For up to n = A000108(11)-2 = 58784, a(n) = A007953(A239903(n)).
Catalan numbers, A000108, give the positions of ones, and the n-th triangular number occurs for the first time at the position immediately before that, i.e., a(A001453(n)) = A000217(n-1).
For each n, a(n) >= A000217(A236859(n)).

A244320 a(n) = n - A014420(n).

Original entry on oeis.org

0, 0, 1, 1, 2, 4, 4, 5, 5, 6, 8, 8, 9, 9, 13, 13, 14, 14, 15, 17, 17, 18, 18, 19, 21, 21, 22, 22, 26, 26, 27, 27, 28, 30, 30, 31, 31, 32, 34, 34, 35, 35, 41, 41, 42, 42, 43, 45, 45, 46, 46, 47, 49, 49, 50, 50, 54, 54, 55, 55, 56, 58, 58, 59, 59, 60, 62, 62, 63, 63, 67, 67, 68, 68, 69
Offset: 0

Views

Author

Antti Karttunen, Jul 02 2014

Keywords

Crossrefs

Programs

Formula

a(n) = n - A014420(n).

A244234 a(n) = n - A244232(n).

Original entry on oeis.org

0, 0, 1, 1, 1, 4, 4, 5, 5, 5, 6, 6, 6, 9, 13, 13, 14, 14, 14, 17, 17, 18, 18, 18, 19, 19, 19, 22, 22, 23, 23, 23, 24, 24, 24, 27, 31, 31, 32, 32, 32, 35, 41, 41, 42, 42, 42, 45, 45, 46, 46, 46, 47, 47, 47, 50, 54, 54, 55, 55, 55, 58, 58, 59, 59, 59, 60, 60, 60
Offset: 0

Views

Author

Antti Karttunen, Jun 25 2014

Keywords

Crossrefs

Programs

Showing 1-4 of 4 results.