login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A071652
Inverse permutation to A071651.
7
0, 1, 2, 3, 4, 6, 7, 5, 14, 16, 8, 9, 15, 42, 19, 17, 11, 37, 43, 51, 44, 20, 12, 39, 121, 52, 126, 53, 21, 10, 40, 123, 149, 127, 154, 56, 18, 28, 38, 124, 151, 385, 155, 163, 47, 54, 30, 112, 122, 152, 387, 475, 164, 135, 156, 57, 13, 114, 376, 150, 388, 477, 503, 136
OFFSET
0,3
PROG
(Scheme functions below show the essential idea. For a complete source, see the "Alternative Catalan Orderings" OEIS Wiki page.)
(define arithrankA061579->lexrank (arithrank->lexrank-bijection A002262 A025581))
(define (arithrank->lexrank-bijection pr1 pr2) (lambda (n) (CatalanRankGlobal (parenthesization->binexp (unrank-bintree n pr1 pr2)))))
(define (unrank-bintree rank pr1 pr2) (cond ((zero? rank) (list)) (else (cons (unrank-bintree (pr1 (-1+ rank)) pr1 pr2) (unrank-bintree (pr2 (-1+ rank)) pr1 pr2)))))
(define (A002262 n) (- n (binomial_n_2 (floor->exact (+ (/ 1 2) (sqrt (* 2 (1+ n))))))))
(define (A025581 n) (- (binomial_n_2 (1+ (floor->exact (+ (/ 1 2) (sqrt (* 2 (1+ n))))))) (1+ n)))
CROSSREFS
Inverse permutation: A071651. A071671 gives the corresponding parenthesizations (from the term 1 onward) encoded as binary numbers, i.e. A071671(n) = A063171(A071652(n)) for n >= 1.
Sequence in context: A130264 A072659 A072766 * A089884 A172312 A086163
KEYWORD
nonn,tabl
AUTHOR
Antti Karttunen, May 30 2002
STATUS
approved