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.

A209638 Sequence A209636 (or A209637) sorted into ascending order.

Original entry on oeis.org

1, 2, 3, 4, 5, 6, 7, 8, 10, 11, 12, 13, 14, 16, 17, 19, 20, 22, 24, 26, 28, 29, 31, 32, 34, 37, 38, 40, 41, 43, 44, 48, 52, 53, 56, 58, 59, 62, 64, 67, 68, 71, 74, 76, 79, 80, 82, 86, 88, 89, 96, 101, 104, 106, 107, 109, 112, 116, 118, 124, 127, 128, 131, 134
Offset: 0

Views

Author

Antti Karttunen, Mar 11 2012

Keywords

Comments

These are Matula-numbers (see A061773) for the rooted trees where no vertices with more than one non-leaf branch ever occur. In other words, natural numbers which are either some power of 2, or of the form 2^k * p_i, where k >= 0, and p_i is the i-th prime (A000040(i)), with i being one of the terms of this sequence.

Crossrefs

Sorted version of A209636 and A209637.
Subset of A093641 and A122132.

Programs

  • Python
    from sympy import prime
    def a(n):
        n = 2*n
        m = 1
        if n<2: return 1
        while n>1:
            if n%2==0:
                n//=2
                m*=2
            else:
                n=(n - 1)//2
                m=prime(m)
        return m
    print(sorted([a(n) for n in range(101)])) # Indranil Ghosh, May 26 2017

A278542 a(n) = A046523(A209637(n)).

Original entry on oeis.org

1, 2, 2, 4, 2, 2, 6, 8, 2, 2, 2, 2, 6, 6, 12, 16, 2, 2, 2, 2, 2, 2, 2, 2, 6, 6, 6, 6, 12, 12, 24, 32, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 6, 6, 6, 6, 6, 6, 6, 6, 12, 12, 12, 12, 24, 24, 48, 64, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 12, 12, 12
Offset: 0

Views

Author

Antti Karttunen, Nov 30 2016

Keywords

Crossrefs

Programs

Formula

a(n) = A046523(A209637(n)).
a(n) = A278541(A054429(n)).

A209636 Matula-numbers computed for rooted trees encoded by A071162/A071163.

Original entry on oeis.org

1, 2, 4, 3, 8, 6, 7, 5, 16, 12, 14, 10, 19, 13, 17, 11, 32, 24, 28, 20, 38, 26, 34, 22, 53, 37, 43, 29, 67, 41, 59, 31, 64, 48, 56, 40, 76, 52, 68, 44, 106, 74, 86, 58, 134, 82, 118, 62, 131, 89, 107, 71, 163, 101, 139, 79, 241, 157, 191, 109, 331, 179, 277
Offset: 0

Views

Author

Antti Karttunen, Mar 11 2012

Keywords

Comments

Sequence is injective: Any number occurs at most once, as each plane tree encoded by A071162/A071163 is mapped to a unique non-oriented rooted tree. See also A209637, A209638.
Sequence A209638 gives the same terms sorted into ascending order.

Crossrefs

Programs

  • PARI
    A209636(n) = { my(n=2*n, m=1); while(n >= 2, if(!(n%2),m*=2,m = prime(m)); n\=2); m; } \\ Antti Karttunen, May 25 2017
    
  • Python
    from sympy import prime
    def a(n):
        n = 2*n
        m = 1
        if n<2: return 1
        while n>1:
            if n%2==0:
                n//=2
                m*=2
            else:
                n=(n - 1)//2
                m=prime(m)
        return m
    print([a(n) for n in range(101)]) # Indranil Ghosh, May 25 2017, translated from Antti Karttunen's SCHEME code
  • Scheme
    (define (A209636 n) (let loop ((n (* 2 n)) (m 1)) (cond ((< n 2) m) ((even? n) (loop (/ n 2) (* m 2))) (else (loop (/ (- n 1) 2) (A000040 m))))))
    

Formula

a(n) = A127301(A071163(n)) = A209637(A054429(n)).

A071162 Simple rewriting of binary expansion of n resulting A014486-codes for rooted binary trees with height equal to number of internal vertices. (Binary trees where at each internal vertex at least the other child is leaf).

Original entry on oeis.org

0, 2, 10, 12, 42, 44, 52, 56, 170, 172, 180, 184, 212, 216, 232, 240, 682, 684, 692, 696, 724, 728, 744, 752, 852, 856, 872, 880, 936, 944, 976, 992, 2730, 2732, 2740, 2744, 2772, 2776, 2792, 2800, 2900, 2904, 2920, 2928, 2984, 2992, 3024, 3040, 3412, 3416
Offset: 0

Views

Author

Antti Karttunen, May 14 2002

Keywords

Comments

Essentially rewrites in binary expansion of n each 0 -> 01, 1X -> 1(rewrite X)0, where X is the maximal suffix after the 1-bit, which will be rewritten recursively (see the given Scheme-function). Because of this, the terms of the binary length 2n are counted by 2's powers, A000079.
In rooted plane (general) tree context, these are those totally balanced binary sequences (terms of A014486) where non-leaf subtrees can occur only as the rightmost branch (at any level of a general tree), but nowhere else. (Cf. A209642).
Also, these are exactly those rooted plane trees whose Łukasiewicz words happen to be valid asynchronous siteswap juggling patterns. (This was the original, albeit quite frivolous definition of this sequence for almost ten years 2002-2012. Cf. A071160.)

Crossrefs

a(n) = A014486(A071163(n)) = A036044(A209642(n)) = A056539(A209642(n)).
A209859 provides an "inverse" function, i.e. A209859(a(n)) = n for all n.

Programs

  • Python
    def a036044(n): return int(''.join('1' if i == '0' else '0' for i in bin(n)[2:][::-1]), 2)
    def a209642(n):
        s=0
        i=1
        while n!=0:
            if n%2==0:
                n//=2
                s=4*s + 1
            else:
                n=(n - 1)//2
                s=(s + i)*2
            i*=4
        return s
    def a(n): return 0 if n==0 else a036044(a209642(n))
    print([a(n) for n in range(101)]) # Indranil Ghosh, May 25 2017
  • Scheme
    (define (A071162 n) (let loop ((n n) (s 0) (i 1)) (cond ((zero? n) s) ((even? n) (loop (/ n 2) (+ s i) (* i 4))) (else (loop (/ (- n 1) 2) (* 2 (+ s i)) (* i 4))))))
    

A243493 Value of Matula-Goebel signature at the fixed points of A069787: a(n) = A127301(A243490(n)).

Original entry on oeis.org

1, 2, 4, 3, 8, 6, 5, 16, 12, 10, 14, 13, 11, 32, 24, 20, 28, 26, 22, 37, 23, 34, 31, 64, 48, 40, 56, 52, 44, 74, 46, 68, 62, 76, 39, 89, 61, 47, 86, 101, 118, 109, 127, 128, 96, 80, 112, 104, 88, 148, 92, 136, 124, 152, 78, 178, 122, 94, 172, 202, 236, 218, 254
Offset: 0

Views

Author

Antti Karttunen, Jun 07 2014

Keywords

Comments

The first duplicate value occurs at n=101, as a(101) = a(129) = 362. The corresponding A014486-indices are A243490(101) = 924 and A243490(129) = 1640, respectively.

Crossrefs

A243494 gives the same terms sorted into ascending order with duplicates removed.

Formula

a(n) = A127301(A243490(n)).
a(n) = A243491(A243490(n)).
For all n >= 0, a(A036256(n)-1) = A007097(n) and a(A036256(n)) = A000079(n+1).
Showing 1-5 of 5 results.