OFFSET
1,1
COMMENTS
From Jon E. Schoenfield, Jan 11 2018: (Start)
a(15) <= 6937869050647642111;
a(16) <= 7088202090368908328959;
a(17) <= 348624306087955627410980863. (End)
FORMULA
Let C(p) be the result of removing the MSD and the LSD of a prime p. C(p) = (p - 2^floor(log_2(p)) - 1)/2.
EXAMPLE
a(1) = 13, because 13 in base 2 is 1101, 10 is the prime 2; and 13 is the least prime with this property.
a(2) = 59, because 59 = 111011_2, 1101_2 is the prime 13, 10_2 is the prime 2; and 59 is the least prime with this property.
a(3) = 631, because 631 = 1001110111_2, 111011_2 is the prime 59, 1101_2 is the prime 13, 10_2 is the prime 2; and 631 is the least prime with this property.
MAPLE
with(numtheory): P:=proc(q) local a, i, k, n, ok, x; x:=1;
for n from 1 to q do for k from x to q do
a:=convert(ithprime(k), binary, decimal);
ok:=1; for i from 1 to n do a:=trunc(a/10) mod 10^(ilog10(a)-1);
if not isprime(convert(a, decimal, binary)) then ok:=0; break; fi; od;
if ok=1 then x:=k; print(ithprime(k)); break; fi; od; od; end: P(10^10);
MATHEMATICA
With[{s = Map[LengthWhile[#, PrimeQ] &@ NestWhileList[((# - 2^Floor@ Log2@ #) - 1)/2 &, #, # > 2 &] &, Prime@ Range[2^18]]}, Map[Prime@ First@ FirstPosition[s, #] &, Range@ Max@ s]] (* Michael De Vlieger, Jan 10 2018 *)
PROG
(Java) private static BigInteger SearchAn() { BigInteger BIW, BICore; int tN=10; int j3; static final BigInteger BILim = new BigInteger("1000000000"); static final BigInteger BI2 = new BigInteger("2"); for (BIW=BI2; BIW.compareTo(BILim)<0; BIW=BIW.add(BI2)) { BICore = BIW; for (j3=1; j3<tN+1; j3++) { if (!(BICore.isProbablePrime(10))) break; else { BICore=((BICore.subtract(BI2.pow(BICore.bitLength()-1)).subtract(BI1))).divide(BI2); } } if (j3==tN+1) { return BIW; } return BigInteger.ZERO; } }
CROSSREFS
KEYWORD
nonn,base,hard,more
AUTHOR
Paolo Iachia, Paolo P. Lava, Jan 09 2018
EXTENSIONS
a(10)-a(14) from Jon E. Schoenfield, Jan 11 2018
STATUS
approved