OFFSET
0,3
COMMENTS
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
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
LINKS
Michael S. Branicky, Table of n, a(n) for n = 0..155
Eric Weisstein's World of Mathematics, Binary Champernowne Constant
Eric Weisstein's World of Mathematics, Smarandache Number
MATHEMATICA
FromDigits /@ Flatten /@ Rest[FoldList[Append, {}, IntegerDigits[Range[10], 2]]] (* Eric W. Weisstein, Nov 04 2015 *)
PROG
(Python)
from itertools import count, islice
def agen(s=""): yield from (int(s:=s+bin(n)[2:]) for n in count(0))
print(list(islice(agen(), 13))) # Michael S. Branicky, Feb 17 2023
(Python)
from functools import reduce
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
CROSSREFS
KEYWORD
base,easy,nonn
AUTHOR
Henry Bottomley, Jan 12 2001
STATUS
approved