%I #9 Dec 19 2020 08:00:23
%S 0,1,2,3,1,2,3,4,1,2,3,4,2,3,4,5,2,3,4,5,3,4,5,6,3,4,5,6,4,5,6,7,4,5,
%T 6,7,5,6,7,8,5,6,7,8,6,7,8,9,6,7,8,9,7,8,9,10,7,8,9,10,8,9,10,11,1,2,
%U 3,4,2,3,4,5,2,3,4,5,3,4,5,6,3,4,5,6,4,5,6,7,4,5,6,7,5,6,7,8,5,6,7,8,6,7,8,9,6,7
%N The exponent of the highest power of 2 dividing A339821(n).
%H Antti Karttunen, <a href="/A339822/b339822.txt">Table of n, a(n) for n = 0..65537</a>
%H <a href="/index/Bi#binary">Index entries for sequences related to binary expansion of n</a>
%F If 4n = 2^e1 + 2^e2 + ... + 2^ek [e1 ... ek distinct], then a(n) = A023506(e1) + A023506(e2) + ... + A023506(ek).
%F a(n) = A007814(A339821(n)) = A053574(A019565(2n)).
%F a(n) = A007814(A003972(A019565(n))) = A007814(A000010(A019565(2n))).
%o (PARI) A339822(n) = { my(s=0, p=2); while(n>0, p = nextprime(1+p); if(n%2, s += valuation((p-1),2)); n >>= 1); (s); };
%Y Cf. A000010, A003972, A007814, A019565, A023506, A053574, A339814, A339815, A339821.
%K nonn
%O 0,3
%A _Antti Karttunen_, Dec 18 2020