A305827 Beastly primes with beastly prime indices, i.e., primes p such that both the decimal representation of p and the decimal representation of the index of p in A000040 contain the substring "666".
836663, 1266611, 5466607, 10036661, 10856669, 13006667, 17206667, 17256667, 18256669, 19666271, 22466603, 22466617, 22466621, 22466623, 22466629, 26036663, 26668007, 26716667, 30666001, 34876661, 36668171, 39666181, 39876667, 40666103, 41666969, 42666667
Offset: 1
Examples
836663 is prime(66651). Both the prime and its prime index contain the substring "666" in their decimal representation, so 836663 is a term of the sequence.
Programs
-
Mathematica
Select[Prime[Range[26*10^5]],SequenceCount[IntegerDigits[#],{6,6,6}]>0&&SequenceCount[IntegerDigits[PrimePi[#]],{6,6,6}]>0&] (* Harvey P. Dale, Jun 04 2025 *)
-
PARI
is(n) = my(bst=[6, 6, 6], d=digits(n), e=digits(primepi(n))); for(x=1, #e-2, my(v=[e[x], e[x+1], e[x+2]]); if(v==bst, for(y=1, #d-2, my(w=[d[y], d[y+1], d[y+2]]); if(w==bst, return(1))))); 0 forprime(p=1, , if(is(p), print1(p, ", ")))
Extensions
a(7)-a(26) from Giovanni Resta, Jun 11 2018
Comments