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

 


A004755
Binary expansion starts 11.
23
3, 6, 7, 12, 13, 14, 15, 24, 25, 26, 27, 28, 29, 30, 31, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122
OFFSET
1,1
COMMENTS
a(n) is the smallest value > a(n-1) (or > 1 for n=1) for which A001511(a(n)) = A001511(n). - Franklin T. Adams-Watters, Oct 23 2006
LINKS
Kenny Lau, Table of n, a(n) for n = 1..16383 (first 1023 terms from T. D. Noe)
FORMULA
a(2n) = 2*a(n), a(2n+1) = 2*a(n) + 1 + 2*[n==0].
a(n) = n + 2 * 2^floor(log_2(n)) = A004754(n) + A053644(n).
a(n) = 2n + A080079(n). - Benoit Cloitre, Feb 22 2003
G.f.: (1/(1+x)) * (1 + Sum_{k>=0, t=x^2^k} 2^k*(2t+t^2)/(1+t)).
a(n) = n + 2^(floor(log_2(n)) + 1) = n + A062383(n). - Franklin T. Adams-Watters, Oct 23 2006
a(2^m+k) = 2^(m+1) + 2^m + k, m >= 0, 0 <= k < 2^m. - Yosu Yurramendi, Aug 08 2016
EXAMPLE
12 in binary is 1100, so 12 is in the sequence.
MAPLE
a:= proc(n) n+2*2^floor(log(n)/log(2)) end: seq(a(n), n=1..60); # Muniru A Asiru, Oct 16 2018
MATHEMATICA
Flatten[Table[FromDigits[#, 2]&/@(Join[{1, 1}, #]&/@Tuples[{0, 1}, n]), {n, 0, 5}]] (* Harvey P. Dale, Feb 05 2015 *)
PROG
(PARI) a(n)=n+2*2^floor(log(n)/log(2))
(PARI) is(n)=n>2 && binary(n)[2] \\ Charles R Greathouse IV, Sep 23 2012
(Haskell)
import Data.List (transpose)
a004755 n = a004755_list !! (n-1)
a004755_list = 3 : concat (transpose [zs, map (+ 1) zs])
where zs = map (* 2) a004755_list
-- Reinhard Zumkeller, Dec 04 2015
(Python)
f = open('b004755.txt', 'w')
lo = 3
hi = 4
i = 1
while i<16384:
for x in range(lo, hi):
f.write(str(i)+" "+str(x)+"\n")
i += 1
lo <<= 1
hi <<= 1
# Kenny Lau, Jul 05 2016
(Python)
def A004755(n): return n+(1<<n.bit_length()) # Chai Wah Wu, Jul 13 2022
CROSSREFS
Equals union of A079946 and A080565.
Cf. A004754 (10), A004756 (100), A004757 (101), A004758 (110), A004759 (111).
Sequence in context: A092150 A028802 A141742 * A004760 A186083 A093906
KEYWORD
nonn,base,easy
EXTENSIONS
Edited by Ralf Stephan, Oct 12 2003
STATUS
approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | 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 September 23 11:42 EDT 2024. Contains 376164 sequences. (Running on oeis4.)