A228768 Smallest number that is an emirp in all bases from 2 through n.
11, 11, 53, 61, 193, 193, 193, 193, 93836531, 1963209431, 14322793967831, 14322793967831
Offset: 2
Examples
Decimal 193 is 11000001, 21011, 3001, 1233, 521, 364, 301 and 234 in bases 2 through 9, and reversing (and translating back to decimal from these bases) gives primes 131, 113, 67, 461, 53, 241, 67 and 353.
Links
- Wikipedia, Emirp
Programs
-
PARI
emirp(p,b)=my(q,t=p);while(t,q=b*q+t%b;t\=b);isprime(q) && p!=q a(n)=forprime(p=2,,for(b=2,n,if(!emirp(p,b),next(2))); return(p)) \\ Charles R Greathouse IV, Sep 03 2013
-
Python
from gmpy2 import is_prime, next_prime def isemirp(n,b=10): # check if n is emirp in base b x, y = n, 0 while x >= b: x, r = divmod(x,b) y = y*b + r y = y*b + x return n != y and is_prime(y) def A228768(n): m = 1 while True: m = next_prime(m) for b in range(2,n+1): if not isemirp(m,b): break else: return m # Chai Wah Wu, Jun 11 2015
Comments