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!)
A163485 Permutation of integers used for constructing A147995 and A163545. 5
0, 3, 1, 2, 14, 15, 13, 12, 6, 7, 5, 4, 8, 11, 9, 10, 58, 57, 59, 56, 62, 63, 61, 60, 54, 55, 53, 52, 50, 49, 51, 48, 26, 25, 27, 24, 30, 31, 29, 28, 22, 23, 21, 20, 18, 17, 19, 16, 32, 35, 33, 34, 46, 47, 45, 44, 38, 39, 37, 36, 40, 43, 41, 42, 234, 233, 235, 232, 228, 229 (list; graph; refs; listen; history; text; internal format)
OFFSET

0,2

LINKS

A. Karttunen, Table of n, a(n) for n = 0..65535

Index entries for sequences that are permutations of the natural numbers

PROG

(MIT Scheme:)

(define (A163485 n) (let* ((i (floor->exact (/ (A000523 n) 2))) (dd (modulo (floor->exact (/ n (expt 4 i))) 4)) (r (if (zero? n) n (modulo n (expt 4 i))))) (cond ((zero? n) n) ((= 0 dd) (A163485 r)) ((= 1 dd) (+ (* 3 (expt 4 i)) (- (expt 4 i) 1 (A163485 (complement-i-oddpos-lsbs (A057300 r) i))))) ((= 2 dd) (+ (expt 4 i) (- (expt 4 i) 1 (A163485 (complement-i-oddpos-lsbs (A057300 r) i))))) (else (+ (* 2 (expt 4 i)) (A163485 r))))))

(define (complement-i-evenpos-lsbs n i) (if (zero? i) n (+ (- 1 (modulo n 2)) (* 2 (complement-i-oddpos-lsbs (floor->exact (/ n 2)) (-1+ i))))))

(define (complement-i-oddpos-lsbs n i) (+ (* 2 (complement-i-evenpos-lsbs (floor->exact (/ n 2)) i)) (modulo n 2)))

CROSSREFS

Inverse: A163486. This permutation can be used to construct array A147995 and its transpose A163545. See A163355 for a bit similarly defined recursive permutation.

Sequence in context: A198627 A198654 A198661 * A276011 A126038 A088363

Adjacent sequences: A163482 A163483 A163484 * A163486 A163487 A163488

KEYWORD

nonn

AUTHOR

Antti Karttunen, Aug 01 2009

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 March 27 02:29 EDT 2023. Contains 361553 sequences. (Running on oeis4.)