Logo

Greetings from The On-Line Encyclopedia of Integer Sequences!

Hints

Search: id:A163485
Displaying 1-1 of 1 results found. page 1
     Format: long | short | internal | text      Sort: relevance | references | number      Highlight: on | off
A163485 Permutation of integers used for constructing A147995 and A163545. +0
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; listen)
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

PROGRAM

(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: A004468 A145463 A144107 this_sequence A126038 A088363 A143783

Adjacent sequences: A163482 A163483 A163484 this_sequence A163486 A163487 A163488

KEYWORD

nonn

AUTHOR

Antti Karttunen (His-Firstname.His-Surname(AT)gmail.com), Aug 01 2009

page 1

Search completed in 0.002 seconds

Lookup | Welcome | Find friends | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Transforms | Puzzles | Hot | Classics
More pages | Superseeker | Maintained by N. J. A. Sloane (njas@research.att.com)

Last modified December 11 12:57 EST 2009. Contains 170656 sequences.


AT&T Labs Research