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!)
A004759 Binary expansion starts 111. 8

%I #31 Jul 14 2022 02:37:28

%S 7,14,15,28,29,30,31,56,57,58,59,60,61,62,63,112,113,114,115,116,117,

%T 118,119,120,121,122,123,124,125,126,127,224,225,226,227,228,229,230,

%U 231,232,233,234,235,236,237,238,239,240,241,242,243,244

%N Binary expansion starts 111.

%C This is the minimal recursive sequence such that a(1)=7, A007814(a(n))= A007814(n) and A010060(a(n))=A010060(n). - _Vladimir Shevelev_, Apr 23 2009

%H Reinhard Zumkeller, <a href="/A004759/b004759.txt">Table of n, a(n) for n = 1..4095</a>

%F a(2n) = 2a(n), a(2n+1) = 2a(n) + 1 + 6[n==0].

%F a(n) = n + 6 * 2^floor(log_2(n)) = A004758(n) + A053644(n).

%F a(n+1) = min{m > a(n): A007814(m) = A007814(n+1) and A010060(m) = A010060(n+1)}. a(2^k) - a(2^k-1) = A103204(k+2), k >= 1. - _Vladimir Shevelev_, Apr 23 2009

%F a(2^m+k) = 7*2^m + k, m >= 0, 0 <= k < 2^m. - _Yosu Yurramendi_, Aug 08 2016

%e 30 in binary is 11110, so 30 is in sequence.

%t w = {1, 1, 1}; Select[Range[5, 244], If[# < 2^(Length@ w - 1), True, Take[IntegerDigits[#, 2], Length@ w] == w] &] (* _Michael De Vlieger_, Aug 10 2016 *)

%t Sort[FromDigits[#,2]&/@(Flatten[Table[Join[{1,1,1},#]&/@Tuples[{1,0},n],{n,0,5}],1])] (* _Harvey P. Dale_, Sep 01 2016 *)

%o (PARI) a(n)=n+6*2^floor(log(n)/log(2))

%o (Haskell)

%o import Data.List (transpose)

%o a004759 n = a004759_list !! (n-1)

%o a004759_list = 7 : concat (transpose [zs, map (+ 1) zs])

%o where zs = map (* 2) a004759_list

%o -- _Reinhard Zumkeller_, Dec 03 2015

%o (Python)

%o def A004759(n): return n+(3<<n.bit_length()) # _Chai Wah Wu_, Jul 13 2022

%Y Cf. A004754 (10), A004755 (11), A004756 (100), A004757 (101), A004758 (110).

%Y Cf. A004760, A053644, A062050, A076877.

%Y Cf. A007814, A010060, A103204, A159559, A159560, A159615, A159619, A159629, A159698. -_Vladimir Shevelev_, Apr 23 2009

%K nonn,base,easy

%O 1,1

%A _N. J. A. Sloane_

%E Edited by _Ralf Stephan_, Oct 12 2003

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 24 22:17 EDT 2024. Contains 371964 sequences. (Running on oeis4.)