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 #14 Jul 16 2022 17:15:45
%S 2,2,10,4,10,10,42,8,18,10,42,20,42,42,170,16,34,18,74,20,42,42,170,
%T 40,82,42,170,84,170,170,682,32,66,34,138,36,74,74,298,40,82,42,170,
%U 84,170,170,682,80,162,82,330,84,170,170,682,168,338,170,682,340,682,682,2730
%N Write n in binary. Place a 0 right of every 1 without a 0 right of it. a(n) = the decimal value of the result.
%C All terms are even.
%H Vincenzo Librandi, <a href="/A163808/b163808.txt">Table of n, a(n) for n = 1..1000</a>
%e 13 in binary is 1101. The first and last 1 each do not have a 0 right of them. So place a 0 after the first 1 and after the last 1 so as to get 101010. a(13) is the decimal equivalent of 101010, which is 42.
%t f[n_Integer]:=Module[{l=IntegerDigits[n,2]//.{a___,1,1,b___}->{a,1,0,1,b}},If[Last[l]==1,l=Append[l,0],l]; FromDigits[l,2]]; Table[f[i], {i, 60}] (* _Harvey P. Dale_, Aug 13 2009 *)
%Y Cf. A163809.
%K base,nonn
%O 1,1
%A _Leroy Quet_, Aug 04 2009
%E Additional terms provided. _Harvey P. Dale_, Aug 12 2009
%E More terms from _Sean A. Irvine_, Nov 05 2009