login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
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). 5
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 (list; graph; refs; listen; history; text; internal format)
OFFSET
0,3
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.
LINKS
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)).
PROG
(Scheme, with memoizing definec-macro from Antti Karttunen's IntSeq-library)
(definec (A246210 n) (cond ((<= n 1) n) ((negative? (A117966 n)) (+ 1 (* 2 (A246210 (- (A117966 n)))))) (else (* 2 (A246210 (- (A117966 n) 1))))))
(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
CROSSREFS
Inverse: A246209.
Similar or related permutations: A054429, A246208, A246211.
Sequence in context: A356221 A102253 A359799 * A302784 A329889 A296347
KEYWORD
nonn
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 | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 26 06:36 EDT 2024. Contains 371990 sequences. (Running on oeis4.)