login
This site is supported by donations to The OEIS Foundation.

 

Logo


Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A246207 Permutation of nonnegative integers: a(0) = 0, a(1) = 1, a(2n) = A117968(a(n)), a(2n+1) = A117967(1+a(n)). 7
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 (list; graph; refs; listen; history; text; internal format)
OFFSET

0,3

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.

LINKS

Antti Karttunen, Table of n, a(n) for n = 0..8191

Antti Karttunen, Pin & logarithmic scatter plots computed for range 0..2047 only (computed with OEIS "graph" command)

Index entries for sequences that are permutations of the natural numbers

FORMULA

As a composition of related permutations:

a(n) = A246209(A054429(n)).

a(n) = A246211(A246209(n)).

PROG

(Scheme, with memoizing definec-macro from Antti Karttunen's IntSeq-library)

(definec (A246207 n) (cond ((<= n 1) n) ((even? n) (A117968 (A246207 (/ n 2)))) (else (A117967 (+ 1 (A246207 (/ (- n 1) 2)))))))

(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

CROSSREFS

Inverse: A246208.

Related permutations: A140263, A054429, A246209, A246211.

Cf. A117967, A117968.

Sequence in context: A095928 A100114 A078319 * A286615 A200112 A146098

Adjacent sequences:  A246204 A246205 A246206 * A246208 A246209 A246210

KEYWORD

nonn,look

AUTHOR

Antti Karttunen, Aug 19 2014

STATUS

approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recent | More pages
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified November 15 07:25 EST 2018. Contains 317225 sequences. (Running on oeis4.)