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-2 of 2 results.

A071156 Apart from the initial term (0), lists all integers whose factorial expansion ends with 1 (i.e., are odd numbers), do not contain a digit zero and each successive digit to the left is at most one greater than the preceding digit.

Original entry on oeis.org

0, 1, 3, 5, 9, 11, 15, 17, 23, 33, 35, 39, 41, 47, 57, 59, 63, 65, 71, 87, 89, 95, 119, 153, 155, 159, 161, 167, 177, 179, 183, 185, 191, 207, 209, 215, 239, 273, 275, 279, 281, 287, 297, 299, 303, 305, 311, 327, 329, 335, 359, 417, 419, 423, 425, 431, 447, 449
Offset: 0

Views

Author

Antti Karttunen, May 14 2002

Keywords

Comments

a(n) = A085198(A014486(n)) = A071155(A057164(n)). Catalan numbers A000108(n) gives the number of terms whose factorial expansion contain n digits.
0 is included by considering it to have the empty string as its factorial base representation. - Franklin T. Adams-Watters, Jun 28 2006

Crossrefs

The beginning of this sequence expanded in the factorial number system: A071158. Inverse function: A085199. First differences: A085191.
Cf. A000108 (row lengths), A071155, A120696.

A125989 Sum of heights of 10's in binary expansion of n.

Original entry on oeis.org

0, 0, 1, 0, 2, 0, 1, 0, 3, 1, 2, -1, 2, 0, 1, 0, 4, 2, 3, 0, 4, 0, 1, -2, 3, 1, 2, -1, 2, 0, 1, 0, 5, 3, 4, 1, 5, 1, 2, -1, 6, 2, 3, -2, 3, -1, 0, -3, 4, 2, 3, 0, 4, 0, 1, -2, 3, 1, 2, -1, 2, 0, 1, 0, 6, 4, 5, 2, 6, 2, 3, 0, 7, 3, 4, -1, 4, 0, 1, -2, 8, 4, 5, 0, 6, 0, 1, -4, 5, 1, 2, -3, 2, -2, -1
Offset: 0

Views

Author

Antti Karttunen, Jan 02 2007

Keywords

Comments

The 'height' of the digits in the binary expansion of n is here defined by the algorithm where, starting from the least significant bit and the height=0 and proceeding leftwards, all encountered 1-bits decrease the height by one and all 0-bits increase it by one. The sequence gives the sums of heights at the positions where 0 changes to 1 when scanning the binary expansion from right to left. This sequence is used for computing A126302.

Examples

			E.g. the lattice path /\/\ is encoded by 10 as 1010 in binary and both peaks occur at height=1, thus a(10)=2.
In comparison, 11 is 1011 in binary, so the only peak '10' occurs at height -1:
.../
/\/
thus a(11)=-1.
		

Crossrefs

A126302 = a(A014486(n)). Cf. A085198.

Programs

  • Scheme
    (define (A125989 n) (let loop ((n n) (s 0) (h 0)) (cond ((zero? n) s) ((= 2 (modulo n 4)) (loop (/ (- n 2) 4) (+ s h 1) h)) ((odd? n) (loop (/ (- n 1) 2) s (- h 1))) (else (loop (/ n 2) s (+ 1 h))))))
Showing 1-2 of 2 results.