login
Let n = (2*i + 1)*2^j; then a(n) = i + j.
1

%I #11 Jul 14 2022 02:23:34

%S 0,1,1,2,2,2,3,3,4,3,5,3,6,4,7,4,8,5,9,4,10,6,11,4,12,7,13,5,14,8,15,

%T 5,16,9,17,6,18,10,19,5,20,11,21,7,22,12,23,5,24,13,25,8,26,14,27,6,

%U 28,15,29,9,30,16,31,6

%N Let n = (2*i + 1)*2^j; then a(n) = i + j.

%C n appears n + 1 times.

%F a(n) = A025480(n-1) + A007814(n).

%F a(2*n+1) = n, a(2*n) = A025480(n-1) + A001511(n).

%o (PARI) a(n) = my(j = valuation(n, 2), i = ((n/2^j)-1)/2); i+j; \\ _Michel Marcus_, Apr 09 2016

%o (Python)

%o def A271519(n): return (n-1>>(m:=(~n&n-1).bit_length())+1)+m # _Chai Wah Wu_, Jul 13 2022

%Y Cf. A001511, A007814, A025480.

%K nonn

%O 1,4

%A _Gionata Neri_, Apr 09 2016