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.

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

A075161 Position of A075165(n+1) in A014486.

Original entry on oeis.org

0, 1, 2, 3, 4, 5, 9, 7, 6, 10, 23, 12, 65, 24, 11, 8, 197, 15, 626, 26, 25, 66, 2056, 13, 14, 198, 16, 68, 6918, 29, 23714, 17, 67, 627, 28, 40, 82500, 2057, 199, 27, 290512, 71, 1033412, 200, 30, 6919, 3707852, 31, 37, 38, 628, 629, 13402697, 43, 70, 69, 2058
Offset: 0

Views

Author

Antti Karttunen, Sep 13 2002

Keywords

Comments

See A075166.

Crossrefs

Inverse of A075162. a(n) = A075163(n+1)-1. Cf. A075168.

A075164 Position of A014486(n-1) in A075165.

Original entry on oeis.org

1, 2, 3, 4, 5, 6, 9, 8, 16, 7, 10, 15, 12, 24, 25, 18, 27, 32, 64, 81, 512, 256, 65536, 11, 14, 21, 20, 40, 35, 30, 45, 48, 96, 135, 768, 384, 98304, 49, 50, 75, 36, 72, 125, 54, 243, 128, 1024, 729, 32768, 4096, 16777216, 625, 162, 19683, 33554432, 262144
Offset: 1

Views

Author

Antti Karttunen, Sep 13 2002

Keywords

Comments

See A075166.

Crossrefs

Inverse of A075163. a(n) = A075162(n-1)+1.

Formula

a(n) = A106443(A106454(n)). A000040(n) = a(1+A014137(n)). The powers of two are located at indices given by A057548 + 1, permuted by this same sequence, i.e. a(A057548(n)+1) = A000079(a(n)). - Antti Karttunen, May 09 2005

A106452 Position of A014486(n) in A106455, minus one.

Original entry on oeis.org

0, 1, 2, 3, 6, 5, 4, 7, 15, 10, 13, 8, 11, 23, 20, 9, 14, 127, 63, 16, 31, 255, 65535, 12, 21, 28, 27, 55, 48, 17, 26, 191, 95, 44, 47, 383, 98303, 68, 41, 62, 19, 39, 106, 29, 254, 2047, 16383, 84, 511, 4095, 16777215, 272, 33, 50, 2097151, 1023, 256, 32767
Offset: 0

Views

Author

Antti Karttunen, May 09 2005

Keywords

Comments

See A106456. The next term, a(58) = 340282366920938463463374607431768211455 = (2^128) - 1 as A063171(58) = 1110101000, 11010100 = A063171(17), a(17)=127 and 127+1 = 128.

Crossrefs

Inverse: A106451. a(n) = A106454(n+1)-1. GF(2)[X]-analog of A075162.
Showing 1-4 of 4 results.