Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).
%I #22 Jan 30 2023 09:35:19
%S 0,0,2,2,0,0,2,2,8,8,10,10,8,8,10,10,0,0,2,2,0,0,2,2,8,8,10,10,8,8,10,
%T 10,32,32,34,34,32,32,34,34,40,40,42,42,40,40,42,42,32,32,34,34,32,32,
%U 34,34,40,40,42,42,40,40,42,42,0,0,2,2,0,0,2,2,8,8,10,10,8,8,10,10,0,0
%N Remove even-positioned bits from the binary expansion of n.
%H Reinhard Zumkeller, <a href="/A063695/b063695.txt">Table of n, a(n) for n = 0..10000</a>
%H Ralf Stephan, <a href="/somedcgf.html">Some divide-and-conquer sequences ...</a>
%H Ralf Stephan, <a href="/A079944/a079944.ps">Table of generating functions</a>
%F a(n) + A063694(n) = n.
%F a(n) = 2*(floor(n/2)-a(floor(n/2))). - _Vladeta Jovovic_, Feb 23 2003
%F From _Ralf Stephan_, Oct 06 2003: (Start)
%F G.f. 1/(1-x) * Sum_{k>=0} (-2)^k*2t^2/(1-t^2) where t = x^2^k.
%F Members of A004514 written twice.
%F (End)
%F a(n) = 4 * a(floor(n / 4)) + 2 * floor(n mod 4 / 2). - _Reinhard Zumkeller_, Sep 26 2015
%F a(n) = A090569(n+1)-1. - _R. J. Mathar_, Jun 22 2020
%e a(25) = 8 because 25 = 11001 in binary and when we AND this with 1010 we are left with 1000 = 8.
%p [seq(every_other_pos(j,2,1),j=0..120)]; # Function every_other_pos given at A063694.
%o (Haskell)
%o a063695 0 = 0
%o a063695 n = 4 * a063695 n' + 2 * div q 2
%o where (n', q) = divMod n 4
%o -- _Reinhard Zumkeller_, Sep 26 2015
%o (Python)
%o def A063695(n): return n&((1<<(m:=n.bit_length())+(m&1^1))-1)//3 # _Chai Wah Wu_, Jan 30 2023
%Y Cf. A004514 (bisection), A063694 (remove odd-positioned bits), A090569.
%K nonn,base,easy
%O 0,3
%A _Antti Karttunen_, Aug 03 2001