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.

A246660 Run Length Transform of factorials.

Original entry on oeis.org

1, 1, 1, 2, 1, 1, 2, 6, 1, 1, 1, 2, 2, 2, 6, 24, 1, 1, 1, 2, 1, 1, 2, 6, 2, 2, 2, 4, 6, 6, 24, 120, 1, 1, 1, 2, 1, 1, 2, 6, 1, 1, 1, 2, 2, 2, 6, 24, 2, 2, 2, 4, 2, 2, 4, 12, 6, 6, 6, 12, 24, 24, 120, 720, 1, 1, 1, 2, 1, 1, 2, 6, 1, 1, 1, 2, 2, 2, 6, 24, 1, 1, 1
Offset: 0

Views

Author

Peter Luschny, Sep 07 2014

Keywords

Comments

For the definition of the Run Length Transform see A246595.
Only Jordan-Polya numbers (A001013) are terms of this sequence.

Crossrefs

Cf. A003714 (gives the positions of ones).
Run Length Transforms of other sequences: A001316, A071053, A227349, A246588, A246595, A246596, A246661, A246674.

Programs

  • Mathematica
    Table[Times @@ (Length[#]!&) /@ Select[Split[IntegerDigits[n, 2]], #[[1]] == 1&], {n, 0, 83}] (* Jean-François Alcover, Jul 11 2017 *)
  • PARI
    A246660(n) = { my(i=0, p=1); while(n>0, if(n%2, i++; p = p * i, i = 0); n = n\2); p; };
    for(n=0, 8192, write("b246660.txt", n, " ", A246660(n)));
    \\ Antti Karttunen, Sep 08 2014
    
  • Python
    from operator import mul
    from functools import reduce
    from re import split
    from math import factorial
    def A246660(n):
        return reduce(mul,(factorial(len(d)) for d in split('0+',bin(n)[2:]) if d)) if n > 0 else 1 # Chai Wah Wu, Sep 09 2014
  • Sage
    def RLT(f, size):
        L = lambda n: [a for a in Integer(n).binary().split('0') if a != '']
        return [mul([f(len(d)) for d in L(n)]) for n in range(size)]
    A246660_list = lambda len: RLT(factorial, len)
    A246660_list(88)
    
  • Scheme
    ;; A stand-alone loop version, like the Pari-program above:
    (define (A246660 n) (let loop ((n n) (i 0) (p 1)) (cond ((zero? n) p) ((odd? n) (loop (/ (- n 1) 2) (+ i 1) (* p (+ 1 i)))) (else (loop (/ n 2) 0 p)))))
    ;; One based on given recurrence, utilizing memoizing definec-macro from my IntSeq-library:
    (definec (A246660 n) (cond ((zero? n) 1) ((even? n) (A246660 (/ n 2))) (else (* (A007814 (+ n 1)) (A246660 (/ (- n 1) 2))))))
    ;; Yet another implementation, using fold:
    (define (A246660 n) (fold-left (lambda (a r) (* a (A000142 r))) 1 (bisect (reverse (binexp->runcount1list n)) (- 1 (modulo n 2)))))
    (definec (A000142 n) (if (zero? n) 1 (* n (A000142 (- n 1)))))
    ;; Other functions are as in A227349 - Antti Karttunen, Sep 08 2014
    

Formula

a(2^n-1) = n!.
a(0) = 1, a(2n) = a(n), a(2n+1) = a(n) * A007814(2n+2). - Antti Karttunen, Sep 08 2014
a(n) = A112624(A005940(1+n)). - Antti Karttunen, May 29 2017
a(n) = A323505(n) / A323506(n). - Antti Karttunen, Jan 17 2019

A323505 Mirror image of (denominators of) Bernoulli tree, A106831.

Original entry on oeis.org

1, 2, 4, 6, 8, 12, 12, 24, 16, 24, 24, 48, 24, 36, 48, 120, 32, 48, 48, 96, 48, 72, 96, 240, 48, 72, 72, 144, 96, 144, 240, 720, 64, 96, 96, 192, 96, 144, 192, 480, 96, 144, 144, 288, 192, 288, 480, 1440, 96, 144, 144, 288, 144, 216, 288, 720, 192, 288, 288, 576, 480, 720, 1440, 5040, 128, 192, 192, 384, 192, 288, 384, 960, 192, 288, 288
Offset: 0

Views

Author

Antti Karttunen, Jan 16 2019

Keywords

Comments

In contrast to A106831 which follows Woon's original indexing (and orientation), this variant starts with value a(0) = 1, with the rest of terms having an index incremented by one, thus allowing for a simple recurrence.
Sequence contains only terms of A001013 and each a(n) is a multiple of A246660(n).

Examples

			This sequence can be represented as a binary tree:
                                       1
                                       |
                    ...................2....................
                   4                                        6
         8......../ \........12                 12........./ \.......24
        / \                 / \                 / \                 / \
       /   \               /   \               /   \               /   \
      /     \             /     \             /     \             /     \
    16       24         24       48         24       36         48      120
  32  48   48  96     48  72   96  240    48  72   72  144    96  144 240  720
etc.
		

Crossrefs

Cf. A000079 (left edge), A000142 (right edge), A001013, A001511, A036987, A054429, A246660, A323506, A323508.
Cf. A106831 and also A005940, A283477, A322827 for other similar trees.

Programs

Formula

a(0) = 1; and for n > 0, if n is even, a(n) = 2*a(n/2), and if n is odd, a(n) = (A001511(n+1)+1-A036987(n)) * a((n-1)/2).
For n > 0, a(n) = b(A054429(n)), where b(n) = A106831(n-1).
a(n) = A246660(n) * A323506(n).
a(n) = A323508(A005940(1+n)).
Showing 1-2 of 2 results.