login
The OEIS Foundation is supported by donations from users of the OEIS and by a grant from the Simons Foundation.

 

Logo


Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A175047 Write n in binary, then increase each run of 0's by one 0. a(n) is the decimal equivalent of the result. 10
1, 4, 3, 8, 9, 12, 7, 16, 17, 36, 19, 24, 25, 28, 15, 32, 33, 68, 35, 72, 73, 76, 39, 48, 49, 100, 51, 56, 57, 60, 31, 64, 65, 132, 67, 136, 137, 140, 71, 144, 145, 292, 147, 152, 153, 156, 79, 96, 97, 196, 99, 200, 201, 204, 103, 112, 113, 228, 115, 120, 121, 124, 63, 128 (list; graph; refs; listen; history; text; internal format)
OFFSET

1,2

COMMENTS

From Reinhard Zumkeller, Dec 12 2009: (Start)

A070939(a(n)) = A070939(n) + A033264(n);

A171598 and A171599 give record values and where they occur. (End)

LINKS

R. Zumkeller, Table of n, a(n) for n = 1..10000

FORMULA

a(n) = if n<2 then n else 2*(1 + 0^((n+2) mod 4))*a([n/2]) + n mod 2. - Reinhard Zumkeller, Jan 20 2010

a(2^n) = 2^(n+1). - Chai Wah Wu, Nov 21 2018

EXAMPLE

12 in binary is 1100. Increase each run of 0 by one digit to get 11000, which is 24 in decimal. So a(12) = 24.

MATHEMATICA

f[n_] := Block[{s = Split@ IntegerDigits[n, 2]}, FromDigits[ Flatten@ Insert[s, {0}, Table[{2 i}, {i, Floor[ Length@s/2]} ]], 2]]; Arrar[ f, 64] (* Robert G. Wilson v, Dec 11 2009 *)

PROG

(Haskell)

import Data.List (group)

a175047 = foldr (\b v -> 2 * v + b) 0 . concatMap

   (\bs@(b:_) -> if b == 0 then 0 : bs else bs) . group . a030308_row

-- Reinhard Zumkeller, Jul 05 2013

(Python)

from re import split

def A175047(n):

  return int(''.join(d+'0' if '0' in d else d for d in split('(0+)|(1+)', bin(n)[2:]) if d != '' and d != None), 2) # Chai Wah Wu, Nov 21 2018

CROSSREFS

Cf. A175046, A175048.

Cf. A084471. - Robert G. Wilson v, Dec 11 2009

Cf. A030308, A106151, A007088.

Sequence in context: A171527 A240969 A198576 * A316688 A309517 A105185

Adjacent sequences:  A175044 A175045 A175046 * A175048 A175049 A175050

KEYWORD

base,nonn

AUTHOR

Leroy Quet, Dec 02 2009

EXTENSIONS

Extended by Ray Chandler, Dec 18 2009

a(11) onwards from Robert G. Wilson v and Reinhard Zumkeller, Dec 11 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 | Recent
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified January 24 08:21 EST 2021. Contains 340398 sequences. (Running on oeis4.)