[go: up one dir, main page]

login
A213726
a(n)=0 if n is in the infinite trunk of the "beanstalk" (i.e., in A179016), otherwise number of terminal nodes (leaves) in that finite branch of the beanstalk.
10
0, 0, 1, 0, 0, 1, 1, 0, 0, 1, 2, 0, 1, 1, 1, 0, 0, 1, 2, 0, 1, 1, 3, 0, 1, 2, 0, 1, 1, 1, 1, 0, 0, 1, 2, 0, 1, 1, 3, 0, 1, 2, 0, 1, 1, 1, 0, 4, 1, 0, 3, 1, 1, 0, 2, 1, 2, 0, 1, 1, 1, 1, 1, 0, 0, 1, 2, 0, 1, 1, 3, 0, 1, 2, 0, 1, 1, 1, 0, 4, 1, 0, 3, 1, 1, 0, 2, 1, 2, 0, 1, 1, 1, 1, 0, 4, 1, 0, 3, 1, 1, 0, 2, 1, 0, 3, 1, 1, 1, 0, 2, 1, 0, 3, 1, 1, 0, 2, 1, 2, 0, 1, 1, 1, 1, 1, 1, 0, 0, 1, 2, 0, 1, 1, 3, 0, 1, 2, 0, 1, 1, 1, 0, 4, 1, 0, 3, 1, 1, 0, 2, 1, 2, 0, 1, 1, 1, 1, 0, 4, 1, 0, 3, 1, 1, 0, 2, 1, 0, 3, 1, 1, 1, 0, 2, 1, 0, 3, 1, 1, 0, 2, 1, 2, 0, 1, 1, 1, 1, 1, 0, 4, 1, 0, 3, 1, 1, 0, 2, 1, 0, 3, 1, 1, 1, 0, 2, 1, 6
OFFSET
0,11
COMMENTS
a(n) tells for each natural number n, whether it belongs to the infinite trunk of beanstalk (when a(n)=0), or if it is one of the terminal nodes (i.e., leaves, A055938) (when a(n)=1), or otherwise, when a(n)>1, tells from how many terminal nodes one can end to this n, by repeatedly subtracting their bit count (A000120) from them (as explained in A071542).
LINKS
FORMULA
If A079559(n)=0, a(n)=1; otherwise, if A213719(n)=1, a(n)=0; otherwise a(n) = a(A213723(n))+a(A213724(n)).
EXAMPLE
a(10)=2 because the only numbers in A055938 from which one can end to 10 by the process described in A071542/A179016 are 12 and 13 (see comment at A213717). Similarly, a(22)=3 as there are following three cases: 24 as 24-A000120(24) = 24-2 = 22, and also 28 & 29 as 28-A000120(28) = 28-3 = 25, and 29-A000120(29) = 29-4 = 25, and then 25-A000120(25) = 25-3 = 22.
PROG
(Scheme with memoization-macro definec): (definec (A213726 n) (cond ((zero? (A079559 n)) 1) ((not (zero? (A213719 n))) 0) (else (+ (A213726 (A213723 n)) (A213726 (A213724 n))))))
CROSSREFS
Differs from A213725 for the first time at n=208, where a(n)=6, while A213725(208)=5.
For all n, a(A179016(n)) = 0, a(A055938(n)) = 1, and a(A213717(n)) >= 2. For all n, A213727(A213717(n)) = (2*a(A213717(n)))-1. Cf. A213725-A213731. Records: A218548, A218549.
Sequence in context: A293139 A351319 A213725 * A116929 A059984 A046675
KEYWORD
nonn
AUTHOR
Antti Karttunen, Nov 01 2012
STATUS
approved