login
a(1) = a(2) = 0; for n > 2: a(2n) = 1 + a(n), a(2n+1) = a(A064989(2n+1)).
7

%I #29 Sep 07 2016 04:59:38

%S 0,0,0,1,0,1,0,2,1,1,0,2,0,1,1,3,0,2,0,2,1,1,0,3,1,1,2,2,0,2,0,4,1,1,

%T 1,3,0,1,1,3,0,2,0,2,2,1,0,4,1,2,1,2,0,3,1,3,1,1,0,3,0,1,2,5,1,2,0,2,

%U 1,2,0,4,0,1,2,2,1,2,0,4,3,1,0,3,1,1,1,3,0,3,1,2,1,1,1,5,0,2,2,3,0,2,0,3,2,1,0,4,0,2,1,4,0,2,1,2,2,1,1,4,1,1,1,2,2,3,0,6

%N a(1) = a(2) = 0; for n > 2: a(2n) = 1 + a(n), a(2n+1) = a(A064989(2n+1)).

%C Consider the binary tree illustrated in A005940: If we start from any n, computing successive iterations of A252463 until 1 is reached (i.e., we are traversing level by level towards the root of the tree, starting from that vertex of the tree where n is located), a(n) gives the number of even numbers > 2 encountered on the path (i.e., excluding the 2 from the count but including the starting n if it was even).

%C The number of pairs in any factorization tree of n. For example, a possible factorization tree of 12 is 12 -> (4*3) -> (2*2)*3. There are 2 pairs in this factor tree: (4*3) and (2*2). Thus, a(12) - 1 = 3 - 1 = 2. - _Melvin Peralta_, Aug 29 2016

%H Antti Karttunen, <a href="/A252736/b252736.txt">Table of n, a(n) for n = 1..8192</a>

%F a(1) = a(2) = 0; for n > 2: a(2n) = 1 + a(n), a(2n+1) = a(A064989(2n+1)).

%F a(n) = A080791(A243071(n)). [Number of nonleading 0-bits in A243071(n).]

%F Other identities. For all n >= 2:

%F a(n) = A000120(A156552(n)) - 1. [One less than the binary weight of A156552(n).]

%F a(n) = A252464(n) - A252735(n) - 1.

%F a(n) = A001222(n) - 1.

%t a[1] = a[2] = 0; a[n_] := a[n] = If[EvenQ@ n, 1 + a[n/2], a[Times @@ Power[Which[# == 1, 1, # == 2, 1, True, NextPrime[#, -1]] & /@ First@ #, Last@ #] &@ Transpose@ FactorInteger@ n]]; Array[a, 120] (* _Michael De Vlieger_, Aug 30 2016 *)

%o (Scheme, with memoization-macro definec)

%o (definec (A252736 n) (cond ((<= n 2) 0) ((odd? n) (A252736 (A064989 n))) (else (+ 1 (A252736 (/ n 2))))))

%Y Essentially one less than A001222.

%Y Cf. A000120, A005940, A064989, A080791, A156552, A243071, A252464, A252735.

%Y Cf. also A246370.

%K nonn

%O 1,8

%A _Antti Karttunen_, Dec 21 2014