(Translated by https://www.hiragana.jp/)
A256478 - OEIS
login
A256478
a(0) = 0; and for n >= 1, if A079559(n) = 1, then a(n) = 1 + a(A213714(n)-1), otherwise a(n) = a(A234017(n)).
7
0, 1, 1, 2, 2, 1, 2, 3, 3, 2, 2, 3, 1, 2, 3, 4, 4, 3, 3, 3, 2, 2, 4, 2, 3, 3, 4, 1, 2, 3, 4, 5, 5, 4, 4, 4, 3, 3, 4, 3, 3, 3, 5, 2, 2, 4, 3, 4, 2, 4, 5, 3, 3, 2, 3, 4, 4, 5, 1, 2, 3, 4, 5, 6, 6, 5, 5, 5, 4, 4, 5, 4, 4, 4, 5, 3, 3, 4, 4, 4, 3, 4, 6, 3, 3, 3, 3, 5, 5, 4, 2, 2, 4, 3, 5, 3, 4, 5, 6, 2, 4, 4, 4, 5, 3, 4, 3, 3, 2, 5, 5, 3, 6, 2, 4, 4, 3, 4, 5, 5, 6, 1, 2, 3, 4, 5, 6, 7, 7
OFFSET
0,4
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. This count includes both n (in case it is a term of A005187) and 1 (but not 0). See also comments in A256479 and A256991.
The 1's (seem to) occur at positions given by A000325.
LINKS
FORMULA
a(0) = 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) = A000120(A233277(n)). [Binary weight of A233277(n).]
Other identities and observations. For all n >= 1:
a(n) = 1 + A257248(n) = 1 + A080791(A233275(n)).
a(n) = A070939(n) - A256479(n).
a(n) >= A255559(n).
PROG
(Scheme, with memoization-macro definec)
(definec (A256478 n) (if (< n 1) n (+ (A079559 n) (A256478 (if (zero? (A079559 n)) (A234017 n) (+ -1 (A213714 n)))))))
;; Alternative definitions:
(define (A256478 n) (A000120 (A233277 n)))
(define (A256478 n) (if (zero? n) n (+ 1 (A080791 (A233275 n)))))
KEYWORD
nonn
AUTHOR
Antti Karttunen, Apr 15 2015
STATUS
approved