OFFSET
1,1
LINKS
Paolo P. Lava, List of n, prime and starting number for 1 <= n <= 100 [The entries -1 are probably wrong: for n <= 100, no value has been reached for n = 36, 42 and 63, testing S up to 10^6.]
EXAMPLE
a(1) = 2, the first prime;
a(2) = 11 because 2 and 3 in base 2 are 10 and 11 and their concatenation is 1011 which is 11 in base 10;
a(5) = 96137 because 5, 6, 7, 8, 9 written in base 2 and concatenated give 10111011110001001 which is the prime 96137 in base 10.
a(6) = 18428720883408311299 because 1022, 1023, 1024, 1025, 1026 and 1027 written in base 2 and concatenated give 1111111110111111111110000000000100000000011000000001010000000011 which is the prime 18428720883408311299 in base 10.
MAPLE
with(numtheory): P:= proc(q) local a, b, c, k, j, n; print(2);
for k from 2 to q do if k mod 2=0 then c:=2 else c:=1; fi;
for n from c by 2 to q do a:=convert(n, binary); b:=convert(n+1, binary);
for j from 1 to k-1 do b:=convert(n+j, binary); a:=a*10^(ilog10(b)+1)+b; od; a:=convert(a, decimal, binary); if isprime(a) then print(a); break; fi; od; od; end: P(10^6);
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Paolo P. Lava, Mar 10 2016
STATUS
approved