OFFSET
0,1
LINKS
Paolo P. Lava, Table of n, a(n) for n = 0..200
EXAMPLE
a(4) = 19 because the concatenation of 19, 23, 29, 31, 37 in base 2 is concat(concat(concat(concat(10011, 10111), 11101), 11111), 100101) that is the prime 41414629 in base 10 and 19 is the least prime to have this property.
MAPLE
with(numtheory): P:=proc(q) local a, b, c, i, k, n;
for n from 1 to q do for k from 1 to q do
a:=ithprime(k); b:=convert(a, binary, decimal);
for i from 1 to n-1 do a:=nextprime(a);
c:=convert(a, binary, decimal); b:=b*10^(ilog10(c)+1)+c; od;
a:=convert(b, decimal, binary); if isprime(a) then print(ithprime(k)); break; fi; od; od; end: P(10^3);
MATHEMATICA
Table[Prime@ SelectFirst[Range[2^12], Function[k, PrimeQ@ FromDigits[Join @@ IntegerDigits[Prime@ Range[k, k + n], 2], 2]]], {n, 0, 55}] (* Michael De Vlieger, Jan 09 2018 *)
PROG
(PARI) eva(n) = subst(Pol(n), x, 10)
decimal(v, base) = my(w=[]); for(k=0, #v-1, w=concat(w, v[#v-k]*base^k)); sum(i=1, #w, w[i])
concat_primes(start, num) = my(v=[], s=""); forprime(p=start, , v=concat(v, [eva(binary(p))]); if(#v==num, break)); for(k=1, #v, s=concat(s, Str(v[k]))); eval(s)
a(n) = forprime(k=1, , if(ispseudoprime(decimal(digits(concat_primes(k, n+1)), 2)), return(k))) \\ Felix Fröhlich, Jan 09 2018
CROSSREFS
KEYWORD
nonn,base,easy
AUTHOR
Paolo P. Lava, Jan 09 2018
STATUS
approved