Logo

Greetings from The On-Line Encyclopedia of Integer Sequences!

Hints

Search: id:A116626
Displaying 1-1 of 1 results found. page 1
     Format: long | short | internal | text      Sort: relevance | references | number      Highlight: on | off
A116626 a(1)=1; a(odd n) = a(n-1) XOR a(n-2), for a(even n) we find the first i > 1 such that neither i nor (i XOR A116626(n-1)) is present in A116626(1..n-1), in which case a(n) = (i XOR A116626(n-1)). +0
6
1, 3, 2, 6, 4, 12, 8, 13, 5, 15, 10, 26, 16, 23, 7, 14, 9, 24, 17, 49, 32, 43, 11, 25, 18, 51, 33, 50, 19, 48, 35, 55, 20, 54, 34, 52, 22, 62, 40, 61, 21, 60, 41, 53, 28, 56, 36, 63, 27, 91, 64, 93, 29, 59, 38, 57, 31, 58, 37, 100, 65, 95, 30, 92, 66, 101, 39, 99, 68, 110, 42 (list; graph; listen)
OFFSET

1,2

COMMENT

This is a permutation of the natural numbers provided that A116625 is the complement of A116624. XOR is A003987.

LINKS

Index entries for sequences that are permutations of the natural numbers

PROGRAM

(MIT Scheme:)

(define (A116626 n) (cond ((= 1 n) 1) ((odd? n) (A003987bi (A116626 (-1+ n)) (A116626 (- n 2)))) (else (let outloop ((i (A116648 (-1+ n)))) (let ((k (A003987bi i (A116626 (-1+ n))))) (let inloop ((j (- n 1))) (cond ((zero? j) k) ((= i (A116626 j)) (outloop (+ i 1))) ((= k (A116626 j)) (outloop (+ i 1))) (else (inloop (- j 1))))))))))

CROSSREFS

Cf. a(2n) = a(2n-1) XOR a(2n+1), a(2n+1) = A116624(n+1). Inverse: A116627. Bisections: A116624, A116625. Cf. A116648.

Sequence in context: A160795 A113320 A092401 this_sequence A162255 A074323 A164073

Adjacent sequences: A116623 A116624 A116625 this_sequence A116627 A116628 A116629

KEYWORD

nonn

AUTHOR

Paul D. Hanna (pauldhanna(AT)juno.com) and Antti Karttunen (His-Firstname.His-Surname(AT)gmail.com), Feb 21 2006

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 15 00:47 EST 2009. Contains 170825 sequences.


AT&T Labs Research