login
A254045
a(1) = 0, for n > 1: a(n) = a(A253889(n)) + floor((n modulo 3)/2).
6
0, 1, 0, 1, 2, 0, 1, 1, 1, 3, 2, 2, 2, 3, 1, 1, 1, 0, 0, 2, 3, 3, 2, 2, 2, 2, 1, 2, 4, 2, 1, 3, 4, 1, 3, 4, 3, 3, 3, 4, 4, 2, 2, 2, 3, 1, 2, 2, 3, 2, 4, 3, 1, 2, 2, 1, 2, 2, 3, 5, 3, 4, 1, 3, 4, 0, 3, 3, 5, 5, 3, 3, 4, 3, 4, 4, 3, 2, 3, 2, 1, 3, 3, 4, 2, 5, 3, 2, 3, 3, 3, 2, 2, 2, 4, 3, 1, 5, 5, 4, 2, 2, 1, 4, 1, 3, 5, 1, 5, 4, 3, 3, 4, 1, 3, 4, 3, 6, 5, 3, 1, 5, 3, 2, 3, 3, 5, 3
OFFSET
1,5
LINKS
FORMULA
a(1) = 0, for n > 1: a(n) = a(A253889(n)) + floor((n modulo 3)/2).
a(1) = 0, thereafter, if n = 3k+2, then a(3k+2) = 1 + a(k+1), otherwise a(n) = a(A253889(n)).
a(n) = A080791(A064216(n)). [Number of nonleading zeros in binary representation of terms of A064216.]
a(n) = A253894(n) - A254044(n).
Other identities and observations:
a(A007051(n)) = n for all n >= 0.
a(n) >= A253786(n) for all n >= 1.
PROG
(Scheme, three versions, first two using memoizing definec-macro)
(definec (A254045 n) (if (= 1 n) 0 (+ (A254045 (A253889 n)) (floor->exact (/ (modulo n 3) 2)))))
(definec (A254045 n) (cond ((= 1 n) 0) ((= 2 (modulo n 3)) (+ 1 (A254045 (/ (+ 1 n) 3)))) (else (A254045 (A253889 n)))))
(define (A254045 n) (A080791 (A064216 n)))
KEYWORD
nonn
AUTHOR
Antti Karttunen, Jan 23 2015
STATUS
approved