login
Smallest number that is an emirp in all bases from 2 through n.
6

%I #58 Sep 10 2018 02:39:56

%S 11,11,53,61,193,193,193,193,93836531,1963209431,14322793967831,

%T 14322793967831

%N Smallest number that is an emirp in all bases from 2 through n.

%C Note: This sequence would differ almost certainly only in a few smaller terms if (multi-digit) palindromes were also allowed or, in the other direction, if the emirp partners were required to all differ from each other.

%C Numbers in this sequence must lie in specific ranges wherein the leading digit in each composite base is relatively prime to the base. In particular, if a value is to be found that is emirp in bases 2 through 14, its leading digits in bases 4, 6, 8, 9, 10, 12 and 14 are limited to 2/3, 2/5, 4/7, 6/8 (=3/4), 4/9, 4/11 and 6/13 of the possibilities.

%C With searches limited to such ranges, a probability estimate -- based on the Prime Number Theorem -- that a prime number is an emirp is enhanced by a factor expressing knowledge of non-divisibility by the prime divisors of the base and also by the prime factors of the base minus and plus 1. For example, for base 10 the knowledge that a number's reversal is prime and leads with a permissible digit implies that the number itself is not divisible by 2, 3, 5 or 11; and a factor of 2*(3/2)*(5/4)*(11/10)=33/8 would properly be multiplied by the reciprocal of the logarithm of the number to approximate the chance that the number is prime.

%C For the base-14 problem, employing a small (number-dependent) constant c to account for ratios of a number to its different-base reversals and multiplying such factors together provides an overall estimate of (3^5 * 5^4 * 7^5 * 11^3 * 13^3)/(2^28*(log(P)+c)^13) that a large prime, P, with permissible leading digits is an emirp in bases 2 through 14. The rational multiplier is about 27806397.37 or 3.7378900 per base. With calculations based on this way of employing standard heuristics, it turns out that this next term is most likely in the 3rd permissible range, between 5*6^20 and 2*10^16. (The 1st and 2nd are (a(13), 6*9^13) and (3*8^15, 2*14^12), respectively.) But there is an appreciable chance of its arising before that (greater than 10%), and also a not ignorable possibility (3 to 4%) it cannot be found until the 4th range (between 9*14^15 and 8*12^16, the chances being microscopic of this failing). Thus, either luck or excessive use of resources is required.

%H Wikipedia, <a href="http://en.wikipedia.org/wiki/Emirp">Emirp</a>

%e 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.

%o (PARI) emirp(p,b)=my(q,t=p);while(t,q=b*q+t%b;t\=b);isprime(q) && p!=q

%o a(n)=forprime(p=2,,for(b=2,n,if(!emirp(p,b),next(2))); return(p)) \\ _Charles R Greathouse IV_, Sep 03 2013

%o (Python)

%o from gmpy2 import is_prime, next_prime

%o def isemirp(n,b=10): # check if n is emirp in base b

%o ....x, y = n, 0

%o ....while x >= b:

%o ........x, r = divmod(x,b)

%o ........y = y*b + r

%o ....y = y*b + x

%o ....return n != y and is_prime(y)

%o def A228768(n):

%o ....m = 1

%o ....while True:

%o ........m = next_prime(m)

%o ........for b in range(2,n+1):

%o ............if not isemirp(m,b):

%o ................break

%o ........else:

%o ............return m # _Chai Wah Wu_, Jun 11 2015

%Y Cf. A006567, A080790, A136634.

%K nonn,base,more

%O 2,1

%A _James G. Merickel_, Sep 03 2013