login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A175048 Write n in binary, then increase each run of 1's by one 1. a(n) is the decimal equivalent of the result. 6
3, 6, 7, 12, 27, 14, 15, 24, 51, 54, 55, 28, 59, 30, 31, 48, 99, 102, 103, 108, 219, 110, 111, 56, 115, 118, 119, 60, 123, 62, 63, 96, 195, 198, 199, 204, 411, 206, 207, 216, 435, 438, 439, 220, 443, 222, 223, 112, 227, 230, 231, 236, 475, 238, 239, 120, 243, 246 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,1
LINKS
FORMULA
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
EXAMPLE
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.
MATHEMATICA
Table[FromDigits[Flatten[If[MemberQ[#, 1], Join[{1}, #], #]&/@ Split[ IntegerDigits[ n, 2]]], 2], {n, 60}] (* Harvey P. Dale, Oct 10 2013 *)
PROG
(Haskell)
import Data.List (group)
a175048 = foldr (\b v -> 2 * v + b) 0 . concatMap
(\bs@(b:_) -> if b == 1 then 1 : bs else bs) . group . a030308_row
-- Reinhard Zumkeller, Jul 05 2013
(Python)
def a(n): return int(("0"+bin(n)[2:]).replace("01", "011"), 2)
print([a(n) for n in range(1, 61)]) # Michael S. Branicky, Jul 27 2022
CROSSREFS
Sequence in context: A250177 A333002 A333000 * A294231 A280873 A293437
KEYWORD
base,nonn
AUTHOR
Leroy Quet, Dec 02 2009
EXTENSIONS
Extended by Ray Chandler, Dec 18 2009
STATUS
approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 23 10:29 EDT 2024. Contains 371905 sequences. (Running on oeis4.)