This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.
%I A153239 #4 Mar 31 2012 13:21:17 %S A153239 0,0,1,-1,2,2,0,-2,-2,3,3,3,3,3,1,1,-1,-3,-3,-1,-3,-3,-3,4,4,4,4,4,4, %T A153239 4,4,4,4,4,4,4,4,2,2,2,2,2,0,0,-2,-4,-4,-2,-4,-4,-4,0,0,-2,-4,-4,-2, %U A153239 -4,-4,-4,-2,-4,-4,-4,-4,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5 %N A153239 Balance of binary trees as ordered by A014486: number of vertices in the right subtree minus number of vertices in the left subtree. %C A153239 Note that for all n, Sum_{i=A014137(n)}^A014138(n) a(i) = 0. %H A153239 A. Karttunen, <a href="/A153239/b153239.txt">Table of n, a(n) for n = 0..2055</a> %e A153239 A014486(19) encodes the following binary tree: %e A153239 .\/ %e A153239 ..\/.\/ %e A153239 ...\./ %e A153239 Because the subtree at the right contains just one internal node and the subtree at the left contains two, we have a(19) = 1-2 = -1. %o A153239 (MIT Scheme:) %o A153239 (define (A153239 n) (let ((s (A014486->parenthesization (A014486 n)))) (if (null? s) 0 (- (count-pars (cdr s)) (count-pars (car s)))))) %o A153239 (define (count-pars a) (cond ((not (pair? a)) 0) (else (+ 1 (count-pars (car a)) (count-pars (cdr a)))))) %Y A153239 A153243 gives the positions of zeros. Cf. A153240, A153241. %K A153239 sign %O A153239 0,5 %A A153239 _Antti Karttunen_, Dec 21 2008