login
Inverse function of N -> N injection A080298.
4

%I #9 Jan 30 2024 08:23:35

%S 0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,

%T 0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,

%U 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0

%N Inverse function of N -> N injection A080298.

%C a(1)=0 because A080298(0)=1, but a(n) = 0 also for those n which do not occur as values of A080298. All positive natural numbers occur here once.

%C For example, A057163 = A083928(A057163(A080298(n))), i.e. Catalan bijection A057163 embeds into itself in scale n:2n+1 using the obvious zigzag-tree -> binary tree embedding.

%H Antti Karttunen, <a href="https://web.archive.org/web/20021212104851/http://ndirty.cute.fi/~karttu/matikka/Nekomorphisms/gatomorf.htm">Gatomorphisms</a>

%o (Scheme-function showing the essential idea. For the full source, follow the "Catalan bijections" link.)

%o (define (ZigzagTree2BinTree_if_possible gt) (call-with-current-continuation (lambda (e) (let recurse ((gt gt)) (cond ((equal? gt '(() . ())) (list)) ((not (pair? gt)) (e '())) (else (cons (recurse (car gt)) (recurse (cdr gt)))))))))

%Y a(A080298(n)) = n for all n. Cf. A083925-A083927, A083929, A083935.

%K nonn

%O 0,40

%A _Antti Karttunen_, May 13 2003