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.

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)).

A246211 Self-inverse permutation of natural numbers: a(0) = 0, a(1) = 1, and for n > 1, if A117966(n) < 0, a(n) = A117967(1+a(-(A117966(n)))), otherwise a(n) = A117968(a(A117966(n)-1)).

Original entry on oeis.org

0, 1, 5, 22, 71, 2, 35, 15, 99, 225, 531, 66, 213, 516, 1899, 7, 73, 172, 307, 127, 1369, 36, 3, 52, 304, 148, 1246, 5408, 17461, 620, 1567, 5321, 41591, 194, 698, 6, 21, 69, 1489, 5165, 16975, 174, 142234, 643, 17287, 587, 695, 173, 5195, 72, 605, 4770, 23, 1761, 12051, 4175, 24134, 389, 137, 431, 3758, 945, 11964, 392, 419, 482, 11, 2872, 104, 37, 3830, 4, 49, 16
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 the same pair in the opposite order: A117967/A117968, with a(0) set to 0 and a(1) set to 1.

Crossrefs

Related or similar permutations: A246207, A246208, A246209, A246210, A004488, A245812, A054429.

Formula

a(0) = 0, a(1) = 1, and for n > 1, if A117966(n) < 0, a(n) = A117967(1+a(-(A117966(n)))), otherwise a(n) = A117968(a(A117966(n)-1)).

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)).

A246206 Permutation of natural numbers: a(1) = 1, if A117966(n) < 0, a(n) = A014580(a(-(A117966(n)))), otherwise a(n) = A091242(a(A117966(n)-1)).

Original entry on oeis.org

1, 2, 5, 9, 4, 13, 3, 37, 49, 64, 6, 10, 16, 81, 8, 20, 15, 351, 229, 451, 59, 11, 7, 41, 19, 73, 92, 114, 27, 36, 48, 140, 12, 53, 17, 24, 33, 69, 86, 107, 44, 170, 18, 63, 22, 410, 28, 524, 76, 271, 101, 14, 23, 687, 529, 895, 253, 25, 97, 213, 145, 333, 3413, 67, 2091, 31, 607, 103, 415, 4531, 47, 131, 87, 193, 55
Offset: 1

Views

Author

Antti Karttunen, Aug 19 2014

Keywords

Comments

Compare to the formula for A246164. However, instead of reversing binary representation, we employ here balanced ternary enumeration of integers (see A117966).

Crossrefs

Inverse: A246205.
Similar or related entanglement permutations: A246164, A245702, A246202, A246208, A246210.

Formula

a(1) = 1, and for n > 1, if A117966(n) < 0, then a(n) = A014580(a(-(A117966(n)))), otherwise a(n) = A091242(a(A117966(n)-1)).
As a composition of related permutations:
a(n) = A245702(A246208(n)).
a(n) = A246202(A246210(n)).
Showing 1-4 of 4 results.