This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.
%I A296807 #32 Oct 26 2019 20:55:22 %S A296807 2,13,43,151,2143,2143,12479,57727,246527,4267455487,276009615632383, %T A296807 4469780781584383,576406542684520447 %N A296807 Take a prime, convert it to base 2. Consider it as a string of digits and delete its leftmost and rightmost digit. Leading zeros are kept. Repeat the process. a(n) is the least prime that, in the first n steps of this process, generates a string that is a prime read in base 2. %C A296807 a(n) >= 2*4^n + 3*2^n - 1 = A297928(n) >= 2*(4^n + 2^n) + 1 = A085601(n), n > 0. - _Iain Fox_, Dec 29 2017 (edited by _Iain Fox_, Jan 08 2018) %C A296807 a(17) <= 2^163 + 361736822347711983585853439 (probably much smaller), building on a Cunningham chain of length 17 found by Jaroslaw Wroblewski. a(n) exists for n <= 17, and probably for all n. - _Jens Kruse Andersen_, Jan 21 2018 %e A296807 a(1) = 13 because 13 in base 2 is 1101 and 10 is 2 and 13 is the least number with this property; %e A296807 a(2) = 43 because 43 in base 2 is 101011 while 0101 is 5 and 10 is 2 and 43 is the least number with this property; %e A296807 a(3) = 151 because 151 in base 2 is 10010111 while 001011 is 11, 0101 is 5 and 10 is 2 and 151 is the least number with this property. %p A296807 with(numtheory): P:=proc(q) local a,b,c,i,j,k,n,ok,x; x:=5; for k from 1 to q do for n from x to q do a:=convert(ithprime(n),base,2); ok:=1; for i from 1 to k do b:=nops(a)-i; while a[b]=0 do b:=b-1; od; %p A296807 c:=0; for j from b by -1 to i+1 do c:=2*c+a[j]; od;if not isprime(c) then ok:=0; break; fi; od;if ok=1 then x:=n; print(ithprime(n)); break; fi; od; od; end: P(10^20); %t A296807 Table[SelectFirst[Prime@ Range[#, # + 10^5] &@ PrimePi[2 (4^n + 2^n) + 1], AllTrue[Map[FromDigits[#, 2] &, Rest@ NestWhileList[Most@ Rest@ # &, IntegerDigits[#, 2], Length@ # > 2 &]], PrimeQ] &], {n, 8}] (* _Michael De Vlieger_, Dec 29 2017 *) %o A296807 (PARI) a(n) = if(!n, return(2)); forprime(p=2*4^n + 3*2^n - 1, , my(b=p); for(x=1, n, b = (b - (b>=4*2^(logint(p, 2) - 2*x))*4*2^(logint(p, 2) - 2*x) - 1)/2; if(!isprime(b) || (b==2 && x!=n), next(2))); return(p)) \\ _Iain Fox_, Dec 29 2017 (corrected by _Iain Fox_, Oct 26 2019) %Y A296807 Cf. A000030, A010879, A004676, A296806. %K A296807 nonn,base,hard,more %O A296807 0,1 %A A296807 _Paolo P. Lava_, _Paolo Iachia_, Dec 21 2017 %E A296807 Definition corrected, a(10)-a(12) by _Jens Kruse Andersen_, Jan 21 2018