Reminder: The OEIS is hiring a new managing editor, and the application deadline is January 26.
%I #11 Oct 04 2015 13:10:21
%S 0,6,0,3,2,2,0,1,1,38,3,37,0,1,2,33,2,32,0,1,1,30,0,29,1,1,3,28,1,26,
%T 0,24,2,1,0,23,1,1,16,21,1,2,0,1,2,18,0,17,13,1,1,16,1,14,0,1,1,13,0,
%U 10,11,9,0,1,1,8,1,1,1,6,0,4,10,3,1,1,23,2,0,1,2,22,4,20,9,1,3,19,1,5,0,13,2,4,0,11,8,10,1,3,1,2,0,1,6,9,0,8,1,1,2,6,1,1,0,3,1,1,0,2,5,0,12,1
%N a(n)=0 if n is in A259934, otherwise number of nodes (including leaves and the node n itself) in that finite subtree whose root is n and edge-relation is defined by A049820(child) = parent.
%H Antti Karttunen, <a href="/A262697/b262697.txt">Table of n, a(n) for n = 0..17724</a>
%F If A262693(n) = 1 [when n is in A259934],
%F then a(n) = 0,
%F otherwise, if A060990(n) = 0 [when n is one of the leaves, A045765],
%F then a(n) = 1,
%F otherwise:
%F a(n) = 1 + Sum_{k = A082284(n) .. A262686(n)} [A049820(k) = n] * a(k).
%F (In the last clause [ ] stands for Iverson bracket, giving as its result 1 only when A049820(k) = n, and 0 otherwise).
%e For n=1, its transitive closure (as defined by edge-relation A049820(child) = parent) is the union of {1} itself together with all its descendants, together {1, 3, 4, 5, 7, 8}. We see that there are no other nodes in a subtree whose root is 1, because A049820(3) = 3 - d(3) = 1, A049820(4) = 1, A049820(5) = 3, A049820(7) = 5, A049820(8) = 4 and both 7 and 8 are terms of A045765. Thus a(1) = 6.
%e For n=9, its transitive closure is {9, 11, 13, 15, 16, 17, 19, 21, 23, 24, 27, 29, 31, 33, 35, 36, 37, 39, 41, 43, 45, 47, 51, 53, 55, 57, 59, 61, 63, 64, 65, 67, 69, 71, 73, 75, 77, 79}, containing 38 terms, thus a(9) = 38.
%o (Scheme, with memoization-macro definec)
%o (definec (A262697 n) (cond ((= 1 (A262693 n)) 0) (else (let loop ((s 0) (k (A262686 n))) (cond ((<= k n) (+ 1 s)) ((= n (A049820 k)) (loop (+ s (A262697 k)) (- k 1))) (else (loop s (- k 1))))))))
%Y Cf. A000005, A045765, A049820, A060990, A082284, A259934, A262686, A262693.
%Y Cf. A262679, A262522, A262695, A262696, A262890.
%Y Cf. also A213727, A227643, A255327.
%K nonn
%O 0,2
%A _Antti Karttunen_, Oct 04 2015