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.

A246207 Permutation of nonnegative integers: a(0) = 0, a(1) = 1, a(2n) = A117968(a(n)), a(2n+1) = A117967(1+a(n)).

Original entry on oeis.org

0, 1, 2, 5, 7, 3, 22, 15, 23, 11, 6, 4, 71, 35, 66, 52, 58, 33, 25, 12, 21, 16, 8, 17, 172, 99, 73, 36, 213, 148, 194, 137, 197, 152, 75, 43, 59, 29, 24, 13, 69, 49, 68, 47, 19, 9, 64, 45, 587, 419, 225, 127, 173, 104, 72, 37, 516, 304, 620, 431, 643, 447, 601, 462, 640, 441, 577, 423, 177, 103, 203, 155, 211, 150, 61, 30, 57, 34, 26, 53
Offset: 0

Views

Author

Antti Karttunen, Aug 19 2014

Keywords

Comments

This is an instance of entanglement permutation, where complementary pair A005843/A005408 (even and odd numbers respectively) is entangled with complementary pair A117968/A117967 (negative and positive part of inverse of balanced ternary enumeration of integers, respectively), with a(0) set to 0 and a(1) set to 1.
Thus this shares with A140263 the property that after a(0)=0, the even positions contain only terms of A117968 and the odd positions contain only terms of A117967.

Crossrefs

Inverse: A246208.
Related permutations: A140263, A054429, A246209, A246211.

Programs

  • Python
    from sympy.ntheory.factor_ import digits
    def a004488(n): return int("".join([str((3 - i)%3) for i in digits(n, 3)[1:]]), 3)
    def a117968(n):
        if n==1: return 2
        if n%3==0: return 3*a117968(n/3)
        elif n%3==1: return 3*a117968((n - 1)/3) + 2
        else: return 3*a117968((n + 1)/3) + 1
    def a117967(n): return 0 if n==0 else a117968(-n) if n<0 else a004488(a117968(n))
    def a(n): return n if n<2 else a117968(a(n/2)) if n%2==0 else a117967(1 + a((n - 1)/2)) # Indranil Ghosh, Jun 07 2017

Formula

As a composition of related permutations:
a(n) = A246209(A054429(n)).
a(n) = A246211(A246209(n)).

A246208 Permutation of nonnegative integers: a(0) = 0, a(1) = 1, and for n > 1, if A117966(n) < 1, a(n) = 2*a(-(A117966(n))), otherwise a(n) = 1 + 2*a(A117966(n)-1).

Original entry on oeis.org

0, 1, 2, 5, 11, 3, 10, 4, 22, 45, 91, 9, 19, 39, 183, 7, 21, 23, 90, 44, 182, 20, 6, 8, 38, 18, 78, 157, 315, 37, 75, 151, 631, 17, 77, 13, 27, 55, 155, 311, 623, 111, 1263, 35, 303, 47, 181, 43, 365, 41, 89, 367, 15, 79, 314, 156, 630, 76, 16, 36, 150, 74, 302, 180, 46, 88, 14, 366, 42, 40, 364, 12, 54, 26, 110, 34
Offset: 0

Views

Author

Antti Karttunen, Aug 19 2014

Keywords

Comments

This is an instance of entanglement permutation, where complementary pair A117968/A117967 (negative and positive part of inverse of balanced ternary enumeration of integers, respectively) is entangled with complementary pair A005843/A005408 (even and odd numbers respectively), with a(0) set to 0 and a(1) set to 1.
Thus this shares with A140264 the property that apart from a(0) = 0, even numbers occur only in positions given by A117968, and odd numbers only in positions given by A117967.

Crossrefs

Inverse: A246207.
Related permutations: A140264, A054429, A246210, A246211.

Programs

  • Python
    def a117966(n):
        if n==0: return 0
        if n%3==0: return 3*a117966(n//3)
        elif n%3==1: return 3*a117966((n - 1)//3) + 1
        else: return 3*a117966((n - 2)//3) - 1
    def a(n):
        if n<2: return n
        x=a117966(n)
        if x<1: return 2*a(-x)
        else: return 1 + 2*a(x - 1)
    print([a(n) for n in range(101)]) # Indranil Ghosh, Jun 07 2017

Formula

a(0) = 0, a(1) = 1, and for n > 1, if A117966(n) < 1, a(n) = 2*a(-(A117966(n))), otherwise a(n) = 1 + 2*a(A117966(n)-1).
As a composition of related permutations:
a(n) = A054429(A246210(n)).
a(n) = A246210(A246211(n)).

A246209 Permutation of nonnegative integers: a(0) = 0, a(1) = 1, a(2n) = A117967(1+a(n)), a(2n+1) = A117968(a(n)).

Original entry on oeis.org

0, 1, 5, 2, 15, 22, 3, 7, 52, 66, 35, 71, 4, 6, 11, 23, 137, 194, 148, 213, 36, 73, 99, 172, 17, 8, 16, 21, 12, 25, 33, 58, 462, 601, 447, 643, 431, 620, 304, 516, 37, 72, 104, 173, 127, 225, 419, 587, 45, 64, 9, 19, 47, 68, 49, 69, 13, 24, 29, 59, 43, 75, 152, 197, 1273, 1734, 1334, 1940, 1294, 1740, 899, 1556, 1404, 1837, 945, 1567, 389, 698, 1246, 1761, 41
Offset: 0

Views

Author

Antti Karttunen, Aug 19 2014

Keywords

Comments

This is an instance of entanglement permutation, where complementary pair A005843/A005408 (even and odd numbers respectively) is entangled with complementary pair A117967/A117968 (positive and negative part of inverse of balanced ternary enumeration of integers, respectively), with a(0) set to 0 and a(1) set to 1.
This implies that the even positions contain only terms of A117967 and apart from a(1) = 1, the odd positions contain only terms of A117968.

Crossrefs

Inverse: A246210.
Related permutations: A054429, A246207, A246211.

Programs

  • Python
    from sympy.ntheory.factor_ import digits
    def a004488(n): return int("".join(str((3 - i)%3) for i in digits(n, 3)[1:]), 3)
    def a117968(n):
        if n==1: return 2
        if n%3==0: return 3*a117968(n//3)
        elif n%3==1: return 3*a117968((n - 1)//3) + 2
        else: return 3*a117968((n + 1)//3) + 1
    def a117967(n): return 0 if n==0 else a117968(-n) if n<0 else a004488(a117968(n))
    def a(n): return n if n<2 else a117967(1 + a(n//2)) if n%2==0 else a117968(a((n - 1)//2))
    print([a(n) for n in range(101)]) # Indranil Ghosh, Jun 07 2017

Formula

a(0) = 0, a(1) = 1, a(2n) = A117967(1+a(n)), a(2n+1) = A117968(a(n)).
As a composition of related permutations:
a(n) = A246207(A054429(n)).
a(n) = A246211(A246207(n)).

A246210 Permutation of nonnegative integers: a(0) = 0, a(1) = 1, and for n > 1, if A117966(n) < 1, a(n) = 1 + 2*a(-(A117966(n))), otherwise a(n) = 2*a(A117966(n)-1).

Original entry on oeis.org

0, 1, 3, 6, 12, 2, 13, 7, 25, 50, 100, 14, 28, 56, 200, 4, 26, 24, 101, 51, 201, 27, 5, 15, 57, 29, 113, 226, 452, 58, 116, 232, 904, 30, 114, 10, 20, 40, 228, 456, 912, 80, 1808, 60, 464, 48, 202, 52, 402, 54, 102, 400, 8, 112, 453, 227, 905, 115, 31, 59, 233, 117, 465, 203, 49, 103, 9, 401, 53, 55, 403, 11, 41, 21, 81, 61
Offset: 0

Views

Author

Antti Karttunen, Aug 19 2014

Keywords

Comments

This is an instance of entanglement permutation, where complementary pair A117967/A117968 (positive and negative part of inverse of balanced ternary enumeration of integers, respectively) is entangled with complementary pair A005843/A005408 (even and odd numbers respectively), with a(0) set to 0 and a(1) set to 1.
This implies that apart from a(1) = 1, even numbers occur only in positions given by A117967, and odd numbers only in positions given by A117968.

Crossrefs

Inverse: A246209.
Similar or related permutations: A054429, A246208, A246211.

Programs

  • Python
    def a117966(n):
        if n==0: return 0
        if n%3==0: return 3*a117966(n//3)
        elif n%3==1: return 3*a117966((n - 1)//3) + 1
        else: return 3*a117966((n - 2)//3) - 1
    def a(n):
        if n<2: return n
        x=a117966(n)
        if x<1: return 1 + 2*a(-x)
        else: return 2*a(x - 1)
    print([a(n) for n in range(101)]) # Indranil Ghosh, Jun 07 2017

Formula

a(0) = 0, a(1) = 1, and for n > 1, if A117966(n) < 1, a(n) = 1 + 2*a(-(A117966(n))), otherwise a(n) = 2*a(A117966(n)-1).
As a composition of related permutations:
a(n) = A054429(A246208(n)).
a(n) = A246208(A246211(n)).

A245812 Self-inverse permutation of natural numbers: a(0) = 0, a(1) = 1, and for n > 1, if A065620(n) < 0, a(n) = A065621(1+a(-(A065620(n)))), otherwise a(n) = A048724(a(A065620(n)-1)).

Original entry on oeis.org

0, 1, 3, 2, 6, 7, 4, 5, 15, 14, 13, 12, 11, 10, 9, 8, 24, 25, 26, 27, 28, 29, 30, 31, 16, 17, 18, 19, 20, 21, 22, 23, 57, 56, 59, 58, 61, 60, 63, 62, 49, 48, 51, 50, 53, 52, 55, 54, 41, 40, 43, 42, 45, 44, 47, 46, 33, 32, 35, 34, 37, 36, 39, 38, 106, 107, 104, 105, 110, 111, 108, 109, 98, 99, 96, 97, 102, 103, 100
Offset: 0

Views

Author

Antti Karttunen, Aug 20 2014

Keywords

Comments

This is an instance of entanglement permutation, where complementary pair A048724/A065621 is entangled with the same pair in the opposite order: A065621/A048724, with a(1) set to 1.
Note how this is A193231-conjugate of A054429.

Crossrefs

Programs

  • PARI
    a048724(n) = bitxor(n, 2*n);
    a065620(n) = if(n<3, n, if(n%2, -2*a065620((n - 1)/2) + 1, 2*a065620(n/2)));
    a065621(n) = bitxor(n, 2*(n - bitand(n, -n)));
    a(n) = x=a065620(n); if(n<2, n, if(x<0, a065621(1 + a(-x)), a048724(a(x - 1))));
    for(n=0, 100, print1(a(n),", ")) \\ Indranil Ghosh, Jun 07 2017
    
  • Python
    def a048724(n): return n^(2*n)
    def a065620(n): return n if n<3 else 2*a065620(n//2) if n%2==0 else -2*a065620((n - 1)//2) + 1
    def a065621(n): return n^(2*(n - (n & -n)))
    def a(n):
        x=a065620(n)
        return n if n<2 else a065621(1 + a(-x)) if x<0 else a048724(a(x - 1))
    print([a(n) for n in range(101)]) # Indranil Ghosh, Jun 07 2017

Formula

a(0) = 0, a(1) = 1, and for n > 1, if A065620(n) < 0, a(n) = A065621(1+a(-(A065620(n)))), otherwise a(n) = A048724(a(A065620(n)-1)).
Equally:
a(0) = 0, a(1) = 1, and for n > 1, if A010060(n) = 0, a(n) = A065621(1+a(A246159(n))), otherwise a(n) = A048724(a(A246160(n)-1)). [Note how A246159 is an inverse function for A048724, while A246160 is an inverse function for A065621].
As a composition of related permutations:
a(n) = A193231(A234025(n)).
a(n) = A234026(A193231(n)).
a(n) = A193231(A054429(A193231(n))).
Showing 1-5 of 5 results.