A247593 Smallest prime not the middle of one 4 digits longer in base n.
5, 1009, 764051, 7346914823
Offset: 2
Examples
In base 2--binary, decimal 2 and 3 have representations 10 and 11; and binary 101001 and 101111 represent decimal 41 and 47, so that a(2) > 3. Binary 101--decimal 5--has the 4 binary candidates 1010101, 1010111, 1110101, and 1110111--decimal 85, 87, 117 and 119--requiring consideration for primality, but all are composite: a(2)=5.
Programs
-
PARI
ok(n,b)=my(D=b^#digits(n,b),b2=b^2);forstep(k=b^3*D+n*b2,b2*(b2-1)*D+n*b2,D*b2, if(nextprime(k)
Charles R Greathouse IV, Sep 20 2014
Comments