login
A298729
Prime numbers whose decimal expansion includes a substring of seven consecutive 7's.
0
137777777, 177777773, 177777779, 197777777, 307777777, 347777777, 437777777, 527777777, 547777777, 577777777, 587777777, 647777777, 697777777, 777777701, 777777739, 777777743, 777777751, 777777799, 787777777, 827777777, 947777777, 967777777, 1247777777, 1277777771, 1277777773, 1457777777, 1487777777
OFFSET
1,1
MATHEMATICA
s = {7, 7, 7, 7, 7, 7, 7}; lst = {}; k = 1; While[k < 10001, l = 1; il = 12;
While[l < il, p = FromDigits@ Flatten@ Insert[ IntegerDigits[k, 10, 10], s, l];
If[PrimeQ@ p, AppendTo[lst, p]]; l++]; k++]; Union@ lst (* Robert G. Wilson v, Feb 08 2018 *)
PROG
(PARI) is(n) = my(v=vector(7, x, 7), d=digits(n)); for(k=1, #d-6, if([d[k], d[k+1], d[k+2], d[k+3], d[k+4], d[k+5], d[k+6]]==v, return(1))); 0
forprime(p=1, , if(is(p), print1(p, ", "))) \\ Felix Fröhlich, Mar 06 2018
CROSSREFS
KEYWORD
base,nonn,less
AUTHOR
Yohei Furutono, Jan 25 2018
STATUS
approved