|
|
A269710
|
|
Consider the concatenation of n consecutive integers S, S+1, S+2, ..., S+n-1, written in base 2 and then converted to base 10; a(n) gives (in base 10) the first prime reached for any value of S, or -1 if a prime is never reached.
|
|
1
|
|
|
2, 11, 229, 2423, 96137, 18428720883408311299, 3766153, 710506473307, 811194664531, 727558628667293, 38668911739295406763, 421234704182790394882765188961074953258843496042280934188664487937, 148793213122133119638187, 77940588209695579136235195958919
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
1,1
|
|
LINKS
|
|
|
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
|
|
|
STATUS
|
approved
|
|
|
|