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!)
A058935 Concatenation of first n binary numbers. 12

%I #39 Apr 19 2023 12:59:33

%S 0,1,110,11011,11011100,11011100101,11011100101110,11011100101110111,

%T 110111001011101111000,1101110010111011110001001,

%U 11011100101110111100010011010,110111001011101111000100110101011,1101110010111011110001001101010111100

%N Concatenation of first n binary numbers.

%C If the terms are read as decimal numbers, which of them are primes? For example, a(5) = 11011100101 = 1193*9229757 is not a prime. - _N. J. A. Sloane_, Feb 17 2023

%C Answer: a(231) is the first prime term when read as a decimal number; a(15) is the first when read as a binary number. - _Michael S. Branicky_, Feb 17 2023

%H Michael S. Branicky, <a href="/A058935/b058935.txt">Table of n, a(n) for n = 0..155</a>

%H Eric Weisstein's World of Mathematics, <a href="http://mathworld.wolfram.com/BinaryChampernowneConstant.html">Binary Champernowne Constant</a>

%H Eric Weisstein's World of Mathematics, <a href="http://mathworld.wolfram.com/SmarandacheNumber.html">Smarandache Number</a>

%H <a href="/index/Mo#MWP">Index entries for sequences related to Most Wanted Primes video</a>

%F a(n) = a(n-1)*10^A029837(n) + A007088(n).

%t FromDigits /@ Flatten /@ Rest[FoldList[Append, {}, IntegerDigits[Range[10], 2]]] (* _Eric W. Weisstein_, Nov 04 2015 *)

%o (Python)

%o from itertools import count, islice

%o def agen(s=""): yield from (int(s:=s+bin(n)[2:]) for n in count(0))

%o print(list(islice(agen(), 13))) # _Michael S. Branicky_, Feb 17 2023

%o (Python)

%o from functools import reduce

%o def A058935(n): return int(bin(reduce(lambda i,j:(i<<j.bit_length())+j,range(n+1)))[2:]) # _Chai Wah Wu_, Feb 26 2023

%Y Cf. A047778 for this converted to decimal, A001855 (offset) for number of digits.

%Y Cf. A066716: binary Champernowne constant, A030302: binary digits, A030190: same with initial 0, A030303: indices of 1's, A007088.

%Y Other bases: A117640 (4), A007908 (10).

%K base,easy,nonn

%O 0,3

%A _Henry Bottomley_, Jan 12 2001

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 August 29 17:19 EDT 2024. Contains 375518 sequences. (Running on oeis4.)