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

A075157 Run lengths in the binary expansion of n gives the vector of exponents in prime factorization of a(n)+1, with the least significant run corresponding to the exponent of the least prime, 2; with one subtracted from each run length, except for the most significant run of 1's.

Original entry on oeis.org

0, 1, 2, 3, 5, 4, 8, 7, 11, 14, 6, 9, 17, 24, 26, 15, 23, 44, 34, 29, 13, 10, 20, 19, 35, 74, 48, 49, 53, 124, 80, 31, 47, 134, 174, 89, 69, 76, 104, 59, 27, 32, 12, 21, 41, 54, 62, 39, 71, 224, 244, 149, 97, 120, 146, 99, 107, 374, 342, 249, 161, 624, 242, 63, 95, 404
Offset: 0

Views

Author

Antti Karttunen, Sep 13 2002

Keywords

Comments

To make this a permutation of nonnegative integers, we subtract one from each run count except for the most significant run, e.g. a(11) = 9, as 11 = 1011 and 9+1 = 10 = 5^1 * 3^(1-1) * 2^(2-1).

Crossrefs

Programs

  • Haskell
    import Data.List (group)
    a075157 0 = 0
    a075157 n = product (zipWith (^) a000040_list rs') - 1 where
       rs' = reverse $ r : map (subtract 1) rs
       (r:rs) = reverse $ map length $ group $ a030308_row n
    -- Reinhard Zumkeller, Aug 04 2014
    
  • PARI
    A005811(n) = hammingweight(bitxor(n, n>>1));  \\ This function from Gheorghe Coserea, Sep 03 2015
    A286468(n) = { my(p=((n+1)%2), i=0, m=1); while(n>0, if(((n%2)==p), m *= prime(i), p = (n%2); i = i+1); n = n\2); m };
    A075157(n) = if(!n,n,(prime(A005811(n))*A286468(n))-1);
    
  • Scheme
    (define (A075157 n) (if (zero? n) n (+ -1 (* (A000040 (A005811 n)) (fold-left (lambda (a r) (* (A003961 a) (A000079 (- r 1)))) 1 (binexp->runcount1list n))))))
    (define (binexp->runcount1list n) (if (zero? n) (list) (let loop ((n n) (rc (list)) (count 0) (prev-bit (modulo n 2))) (if (zero? n) (cons count rc) (if (eq? (modulo n 2) prev-bit) (loop (floor->exact (/ n 2)) rc (1+ count) (modulo n 2)) (loop (floor->exact (/ n 2)) (cons count rc) 1 (modulo n 2)))))))
    ;; Or, using the code of A286468:
    (define (A075157 n) (if (zero? n) n (- (* (A000040 (A005811 n)) (A286468 n)) 1)))

Formula

a(n) = A075159(n+1) - 1.
a(0) = 0; for n >= 1, a(n) = (A000040(A005811(n)) * A286468(n)) - 1.
Other identities. For all n >= 1:
a(A000975(n)) = A006093(n) = A000040(n)-1.

Extensions

Entry revised, PARI-program added and the old incorrect Scheme-program replaced with a new one by Antti Karttunen, May 17 2017

A286602 Restricted growth sequence transform of A286601.

Original entry on oeis.org

1, 2, 3, 2, 4, 2, 3, 5, 6, 5, 3, 7, 4, 7, 4, 2, 4, 2, 4, 7, 4, 8, 9, 7, 6, 10, 9, 5, 11, 7, 3, 7, 11, 7, 3, 7, 11, 12, 13, 7, 6, 14, 15, 10, 9, 5, 9, 12, 4, 7, 4, 2, 9, 7, 4, 8, 13, 7, 9, 14, 4, 8, 13, 8, 16, 8, 13, 17, 4, 8, 13, 8, 13, 18, 13, 7, 19, 14, 9, 17, 4, 8, 9, 7, 4, 2, 4, 7, 13, 8, 4, 8, 9, 14, 13, 7, 11, 12, 13, 7, 11, 7, 3, 7
Offset: 0

Views

Author

Antti Karttunen, Jun 04 2017

Keywords

Comments

The scatter plot looks complex.

Crossrefs

Cf. A286581, A286589, A286597, A286599, A286600, A286601, A286617, A286619, A286622 for similarly formed sequences.

A278217 Filter-sequence related to base-2 run-length encoding: a(n) = A046523(A075159(1+n)) = A046523(1+A075157(n)).

Original entry on oeis.org

1, 2, 2, 4, 6, 2, 4, 8, 12, 6, 2, 6, 12, 4, 8, 16, 24, 12, 6, 30, 6, 2, 6, 12, 36, 12, 4, 12, 24, 8, 16, 32, 48, 24, 12, 60, 30, 6, 30, 60, 12, 6, 2, 6, 30, 6, 12, 24, 72, 36, 12, 60, 12, 4, 12, 36, 72, 24, 8, 24, 48, 16, 32, 64, 96, 48, 24, 120, 60, 12, 60, 180, 60, 30, 6, 30, 210, 30, 60, 120, 24, 12, 6, 30, 6, 2, 6, 12, 60, 30, 6, 30, 60, 12, 24, 48, 144, 72
Offset: 0

Views

Author

Antti Karttunen, Nov 16 2016

Keywords

Crossrefs

Cf. A046523, A075157, A075159, A286617 (rgs-version of this filter).
Other base-2 related filter sequences: A278219, A278222.
Sequences that partition N into same or coarser equivalence classes are at least these: A092339, A227185.

Programs

Formula

a(n) = A046523(1+A075157(n)) = A046523(A075159(1+n)).

A286539 Restricted growth sequence of A286538.

Original entry on oeis.org

1, 1, 2, 1, 3, 4, 2, 1, 3, 5, 6, 3, 5, 4, 2, 1, 3, 5, 7, 8, 3, 9, 10, 5, 7, 6, 3, 5, 5, 4, 2, 1, 3, 5, 7, 11, 12, 3, 9, 13, 14, 5, 13, 14, 7, 11, 8, 3, 9, 10, 9, 13, 10, 5, 7, 7, 6, 3, 5, 5, 5, 4, 2, 1, 3, 5, 7, 11, 15, 16, 3, 9, 13, 17, 18, 5, 13, 19, 20, 7, 17, 18, 11, 15, 12, 3, 9, 13, 14, 9, 21, 19, 13, 19, 14, 5, 13, 14, 13, 17, 14, 7, 11, 11, 8, 3, 9, 10
Offset: 1

Views

Author

Antti Karttunen, May 17 2017

Keywords

Crossrefs

A286581 Restricted growth sequence transform of A286580.

Original entry on oeis.org

1, 2, 3, 2, 3, 4, 5, 2, 3, 6, 4, 5, 7, 6, 5, 2, 3, 6, 6, 4, 8, 9, 5, 7, 10, 6, 5, 11, 9, 6, 5, 2, 3, 6, 6, 6, 8, 12, 4, 8, 9, 9, 5, 13, 13, 10, 7, 10, 14, 6, 5, 12, 12, 11, 9, 10, 6, 5, 15, 14, 9, 6, 5, 2, 3, 6, 6, 6, 8, 12, 6, 8, 12, 12, 4, 13, 16, 9, 8, 9, 16, 9, 5, 13, 17, 13, 13, 10, 10, 7, 18, 19, 12, 14, 10, 14, 20, 6, 5, 18, 12, 12, 12, 10, 11, 9
Offset: 0

Views

Author

Antti Karttunen, Jun 03 2017

Keywords

Crossrefs

Showing 1-5 of 5 results.