login
A257248
a(1) = 0; and for n > 1, if A079559(n) = 1, then a(n) = 1 + a(A213714(n)-1), otherwise a(n) = a(A234017(n)).
4
0, 0, 1, 1, 0, 1, 2, 2, 1, 1, 2, 0, 1, 2, 3, 3, 2, 2, 2, 1, 1, 3, 1, 2, 2, 3, 0, 1, 2, 3, 4, 4, 3, 3, 3, 2, 2, 3, 2, 2, 2, 4, 1, 1, 3, 2, 3, 1, 3, 4, 2, 2, 1, 2, 3, 3, 4, 0, 1, 2, 3, 4, 5, 5, 4, 4, 4, 3, 3, 4, 3, 3, 3, 4, 2, 2, 3, 3, 3, 2, 3, 5, 2, 2, 2, 2, 4, 4, 3, 1, 1, 3, 2, 4, 2, 3, 4, 5, 1, 3, 3, 3, 4, 2, 3, 2, 2, 1, 4, 4, 2, 5, 1, 3, 3, 2, 3, 4, 4, 5, 0, 1, 2, 3, 4, 5, 6, 6
OFFSET
1,7
COMMENTS
a(n) tells how many nonzero terms of A005187 are encountered when traversing toward the root of binary tree A233276, starting from the node containing n and before 1 is reached. This count includes both n (in case it is a term of A005187) but excludes the 1 and 0 at the root. See also comments in A257249, A256478 and A256991.
LINKS
FORMULA
a(1) = 0; and for n > 1, if A079559(n) = 1, then a(n) = 1 + a(A213714(n)-1), otherwise a(n) = a(A234017(n)).
a(n) = A080791(A233275(n)). [Number of nonleading zeros in the binary representation of A233275(n).]
Other identities. For all n >= 1:
a(n) = A256478(n)-1 = A000120(A233277(n))-1.
a(n) = A070939(n) - A257249(n).
PROG
(Scheme, alternative definitions, the first one utilizing memoizing definec-macro)
(definec (A257248 n) (if (= 1 n) 0 (+ (A079559 n) (A257248 (if (zero? (A079559 n)) (A234017 n) (+ -1 (A213714 n)))))))
(define (A257248 n) (- (A256478 n) 1))
KEYWORD
nonn
AUTHOR
Antti Karttunen, Apr 19 2015
STATUS
approved