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.

A277012 Factorial base representation of n is rewritten as a base-2 number with each nonzero digit k replaced by a run of k 1's (followed by one extra zero if not the rightmost run of 1's) and with each 0 kept as 0.

Original entry on oeis.org

0, 1, 2, 5, 6, 13, 4, 9, 10, 21, 22, 45, 12, 25, 26, 53, 54, 109, 28, 57, 58, 117, 118, 237, 8, 17, 18, 37, 38, 77, 20, 41, 42, 85, 86, 173, 44, 89, 90, 181, 182, 365, 92, 185, 186, 373, 374, 749, 24, 49, 50, 101, 102, 205, 52, 105, 106, 213, 214, 429, 108, 217, 218, 437, 438, 877, 220, 441, 442, 885, 886, 1773, 56, 113, 114, 229, 230, 461, 116, 233
Offset: 0

Views

Author

Antti Karttunen, Sep 25 2016

Keywords

Examples

			9 = "111" in factorial base (3! + 2! + 1! = 9) is converted to three 1-bits with separating zeros between, in binary as "10101" = A007088(21), thus a(9) = 21.
91 = "3301" in factorial base (91 = 3*4! + 3*3! + 1!) is converted to binary number "1110111001" = A007088(953), thus a(91) = 953. Between the rightmost 1-runs the other zero comes from the factorial base representation, while the other zero is an extra separating zero inserted after each run of 1-bits apart from the rightmost 1-run. The single zero between the two leftmost 1-runs is similarly used to separate the two "unary representations" of 3's.
		

Crossrefs

Cf. A277008 (terms sorted into ascending order).
Cf. A277011 (a left inverse).
Differs from analogous A277022 for the first time at n=24, where a(24) = 8, while A277022(24) = 60.

Programs

  • Scheme
    (define (A277012 n) (let loop ((n n) (z 0) (i 2) (j 0)) (if (zero? n) z (let ((d (remainder n i))) (loop (quotient n i) (+ z (* (A000225 d) (A000079 j))) (+ 1 i) (+ 1 j d))))))

Formula

a(n) = A156552(A276076(n)).
Other identities. For all n >= 0:
A277011(a(n)) = n.
A005940(1+a(n)) = A276076(n).
A000035(a(n)) = A000035(n). [Preserves the parity of n.]
A000120(a(n)) = A034968(n).
A069010(a(n)) = A060130(n).
A227349(a(n)) = A227153(n).

A277007 Number of maximal runs of 1-bits (in binary expansion of n) such that the length of run > 1 + the total number of zeros anywhere right of that run.

Original entry on oeis.org

0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 1, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 1, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 1, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 2, 1, 1, 1, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 1, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 1, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 1, 1, 0, 0, 0, 1, 0, 0, 0, 2, 0
Offset: 0

Views

Author

Antti Karttunen, Sep 25 2016

Keywords

Examples

			For n=3, "11" in binary, the only maximal run of 1-bits is of length 2, and 2 > 0+1 (where 0 is the total number of zeros to the right of it), thus a(3) = 1.
For n=59, "111011" in binary, both the length of run "11" at the least significant end exceeds the limit (see case n=3 above), and also the length of run "111" exceeds 1 + the total number of 0's to the right of it, thus a(59) = 1+1 = 2.
For n=60, "111100" in binary, the length of only run of 1's is 4, and 4 > 2+1, thus a(60) = 1.
For n=118, "1110110" in binary, the length of rightmost run of 1-bits is 2, but that is not > 1+1 (one more than the number of 0-bits right to it). Also, the length of the leftmost run of 1-bits is 3, but that is not > 1+2, thus a(118) = 0.
For n=246, "11110110" in binary, the rightmost run of 1-bits does not contribute, but the leftmost run of 1-bits has now length 4, which is more than 1+2 (where 2 is the total number of 0-bits right of it), thus a(246) = 1.
		

Crossrefs

Cf. A277008 (positions of zeros), A277009 (of nonzeros).
Differs from the similar entry A277017 for the first time at n=60, where a(60)=1, while A277017(60)=0.

Programs

  • Scheme
    ;; Standalone iterative implementation:
    (define (A277007 n) (let loop ((e 0) (n n) (z 0) (r 0)) (cond ((zero? n) (+ e (if (> r (+ 1 z)) 1 0))) ((even? n) (loop (+ e (if (> r (+ 1 z)) 1 0)) (/ n 2) (+ 1 z) 0)) (else (loop e (/ (- n 1) 2) z (+ 1 r))))))

Formula

a(n) = A276077(A005940(1+n)).

A277018 Numbers n for which A277017(n) = 0; range of A277022 sorted into ascending order.

Original entry on oeis.org

0, 1, 2, 4, 5, 6, 8, 9, 10, 12, 13, 16, 17, 18, 20, 21, 22, 24, 25, 26, 28, 32, 33, 34, 36, 37, 38, 40, 41, 42, 44, 45, 48, 49, 50, 52, 53, 54, 56, 57, 58, 60, 64, 65, 66, 68, 69, 70, 72, 73, 74, 76, 77, 80, 81, 82, 84, 85, 86, 88, 89, 90, 92, 96, 97, 98, 100, 101, 102, 104, 105, 106, 108, 109, 112, 113, 114, 116, 117, 118, 120
Offset: 0

Views

Author

Antti Karttunen, Sep 26 2016

Keywords

Comments

Numbers such that no run of 1-bits has length >= A000040(1 + the total number of 0-bits anywhere right of that run in the binary expansion of n).
Indexing starts from zero as a(0) = 0 is a special case in this sequence.

Examples

			60 ("111100" in binary, A007088) is present as 4 < prime(2+1) = 5.
		

Crossrefs

Complement: A277019.
Positions of zeros in A277017.
Sequence A277022 sorted into ascending order.
Differs from its subsequence of A277008 for the first time at n=41, where a(41)=60, a value which is missing from A277008.

Formula

Other identitities:
A129251(A005940(1+a(n))) = 0 for all n.

A277009 Numbers not in range of A277012: numbers such that at least one run of 1-bits in their binary expansion is longer than 1 + the total number of 0-bits anywhere right of that run.

Original entry on oeis.org

3, 7, 11, 14, 15, 19, 23, 27, 29, 30, 31, 35, 39, 43, 46, 47, 51, 55, 59, 60, 61, 62, 63, 67, 71, 75, 78, 79, 83, 87, 91, 93, 94, 95, 99, 103, 107, 110, 111, 115, 119, 121, 122, 123, 124, 125, 126, 127, 131, 135, 139, 142, 143, 147, 151, 155, 157, 158, 159, 163, 167, 171, 174, 175, 179, 183, 187, 188, 189, 190, 191, 195, 199, 203
Offset: 1

Views

Author

Antti Karttunen, Sep 25 2016

Keywords

Comments

Numbers n for which A277007(n) > 0.
Numbers n for which A276077(A005940(1+n)) > 0.

Examples

			3 ("11" in binary, A007088) is present as the length of that only run of 1's is 2, and 2 > 1+0, where 0 is the total number of 0's to the right of that run.
60 ("111100" in binary) is present as 4 > 2+1.
246 ("11110110" in binary) is present as the length of the leftmost run of 1-bits is 4, and 4 > 1+2, where 2 is the total number of 0's located anywhere to the right of that run.
		

Crossrefs

Complement: A277008.
Positions of nonzeros in A277007. Numbers not present in A277012.
Differs from its subsequence A277019 for the first time at n=20, where a(20)=60, a term not present in A277019.
Showing 1-4 of 4 results.