cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A175048 Write n in binary, then increase each run of 1's by one 1. a(n) is the decimal equivalent of the result.

This page as a plain text file.
%I A175048 #23 Jul 28 2022 09:23:34
%S A175048 3,6,7,12,27,14,15,24,51,54,55,28,59,30,31,48,99,102,103,108,219,110,
%T A175048 111,56,115,118,119,60,123,62,63,96,195,198,199,204,411,206,207,216,
%U A175048 435,438,439,220,443,222,223,112,227,230,231,236,475,238,239,120,243,246
%N A175048 Write n in binary, then increase each run of 1's by one 1. a(n) is the decimal equivalent of the result.
%H A175048 Reinhard Zumkeller, <a href="/A175048/b175048.txt">Table of n, a(n) for n = 1..10000</a>
%F A175048 a(2^n) = 3*2^n. a(4n) = 2*a(2n), a(4n+1) = 4*a(2n)+3, a(4n+2) = 2*a(2n+1), a(4n+3) = 2*a(2n+1)+1. - _Chai Wah Wu_, Nov 21 2018
%e A175048 12 in binary is 1100. Increase each run of 1 by one digit to get 11100, which is 28 in decimal. So a(12) = 28.
%t A175048 Table[FromDigits[Flatten[If[MemberQ[#,1],Join[{1},#],#]&/@ Split[ IntegerDigits[ n,2]]],2],{n,60}] (* _Harvey P. Dale_, Oct 10 2013 *)
%o A175048 (Haskell)
%o A175048 import Data.List (group)
%o A175048 a175048 = foldr (\b v -> 2 * v + b) 0 . concatMap
%o A175048    (\bs@(b:_) -> if b == 1 then 1 : bs else bs) . group . a030308_row
%o A175048 -- _Reinhard Zumkeller_, Jul 05 2013
%o A175048 (Python)
%o A175048 def a(n): return int(("0"+bin(n)[2:]).replace("01", "011"), 2)
%o A175048 print([a(n) for n in range(1, 61)]) # _Michael S. Branicky_, Jul 27 2022
%Y A175048 Cf. A175046, A175047, A348710.
%Y A175048 Cf. A030308, A007088.
%K A175048 base,nonn
%O A175048 1,1
%A A175048 _Leroy Quet_, Dec 02 2009
%E A175048 Extended by _Ray Chandler_, Dec 18 2009