cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

Showing 1-4 of 4 results.

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

Original entry on oeis.org

11, 11, 53, 61, 193, 193, 193, 193, 93836531, 1963209431, 14322793967831, 14322793967831
Offset: 2

Views

Author

James G. Merickel, Sep 03 2013

Keywords

Comments

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

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.
		

Crossrefs

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

A346113 Base-10 numbers k whose number of divisors equals the number of divisors in R(k), where k is written in all bases from base-2 to base-10 and R(k), the digit reversal of k, is read as a number in the same base.

Original entry on oeis.org

1, 9077, 10523, 10838, 30182, 58529, 73273, 77879, 83893, 244022, 303253, 303449, 304853, 329893, 332249, 334001, 334417, 335939, 336083, 346741, 374617, 391187, 504199, 512695, 516982, 595274, 680354, 687142, 758077, 780391, 792214, 854669, 946217, 948539, 995761, 1008487, 1377067, 1389341
Offset: 1

Views

Author

Scott R. Shannon, Jul 05 2021

Keywords

Comments

There are 633 terms below 50 million and 1253 terms below 100 million. All of those have tau(k), the number of divisors of k, equal to 1, 2, 4, 8 or 16. The first term where tau(k) = 2 is n = 93836531, a prime, which is also the first term of A136634. All terms in A136634 will appear in this sequence, as will all terms in A228768(n) for n>=10. The first term with tau(k) = 4 is 9077, the first with tau(k) = 8 is 595274, and the first with tau(k) = 16 is 5170182. It is possible tau(k) must equal 2^i, with i>=0, although this is unknown.
All known terms are squarefree. - Michel Marcus, Jul 07 2021

Examples

			9077 is a term as the number of divisors of 9077 = tau(9077) = 4, and this equals the number of divisors of R(9077) when written and then read as a base-j number, with 2 <= j <= 10. See the table below for k = 9077.
.
  base | k_base         | R(k_base)      | R(k_base)_10  | tau(R(k_base)_10)
----------------------------------------------------------------------------------
   2   | 10001101110101 | 10101110110001 | 11185         | 4
   3   | 110110012      | 210011011      | 15421         | 4
   4   | 2031311        | 1131302        | 6002          | 4
   5   | 242302         | 203242         | 6697          | 4
   6   | 110005         | 500011         | 38887         | 4
   7   | 35315          | 51353          | 12533         | 4
   8   | 21565          | 56512          | 23882         | 4
   9   | 13405          | 50431          | 33157         | 4
  10   | 9077           | 7709           | 7709          | 4
		

Crossrefs

Cf. A136634 (prime terms), A228768.
Subsequence of A062895.

Programs

  • Mathematica
    Select[Range@100000,Length@Union@DivisorSigma[0,Join[{s=#},FromDigits[Reverse@IntegerDigits[s,#],#]&/@Range[2,10]]]==1&] (* Giorgos Kalogeropoulos, Jul 06 2021 *)
  • PARI
    isok(k) = {my(t= numdiv(k)); for (b=2, 10, my(d=digits(k, b)); if (numdiv(fromdigits(Vecrev(d), b)) != t, return (0));); return(1);} \\ Michel Marcus, Jul 06 2021

A346177 a(n) is the least integer k such that k*prime(n) is in A346113, or 0 if no such k exists.

Original entry on oeis.org

5419, 558227, 102539, 201031, 30553, 76597, 619, 15971, 106174, 313, 381319, 13627, 9137, 1951, 1559, 64157, 5167, 64919, 237163, 13327, 165829, 8698, 4003, 135211, 68674, 16581, 38667, 547, 7841, 120397, 16487, 39367, 2441, 100649, 94889, 12157, 74093, 9466, 4673
Offset: 1

Views

Author

Michel Marcus, Jul 09 2021

Keywords

Comments

a(n) = 1 for prime(n) in A136634.

Crossrefs

Programs

  • PARI
    isok(k) = {my(t = numdiv(k)); for (b=2, 10, my(d=digits(k, b)); if (numdiv(fromdigits(Vecrev(d), b)) != t, return (0));); return(1);} \\ A346113
    a(n) = my(p=prime(n), k=1); while (! isok(k*p), k++); k;

A347209 Emirps in both base 2 and base 10.

Original entry on oeis.org

13, 37, 71, 97, 113, 167, 199, 337, 359, 701, 709, 739, 907, 937, 941, 953, 967, 1033, 1091, 1109, 1153, 1181, 1201, 1217, 1229, 1259, 1439, 1471, 1487, 1669, 1733, 1789, 1811, 1933, 1949, 3019, 3067, 3083, 3089, 3121, 3163, 3221, 3299, 3343, 3389, 3433, 3469, 3511, 3527, 3571, 3583, 3643, 3719
Offset: 1

Views

Author

J. M. Bergot and Robert Israel, Aug 23 2021

Keywords

Comments

Primes p such that A030101(p) and A004086(p) are primes other than p.
Are there any cases where A030101(p) = A004086(p), i.e. emirps in A081434?

Examples

			a(3) = 71 is a term because 71 is prime, its base-10 reversal 17 is a prime other than 71, and its base-2 reversal 113 is a prime other than 71.
		

Crossrefs

Intersection of A006567 and A080790.
Subset of A136634.

Programs

  • Maple
    filter:= proc(n) local L,nL,i,r,s;
      if not isprime(n) then return false fi;
      L:= convert(n,base,10);
      nL:= nops(L);
      r:= add(10^(nL-i)*L[i],i=1..nL);
      if r=n or not isprime(r) then return false fi;
      L:= convert(n,base,2);
      nL:= nops(L);
      s:=add(2^(nL-i)*L[i],i=1..nL);
      s <> n and isprime(s)
    end proc:
    select(filter, [seq(i,i=3..10000,2)]);
  • Mathematica
    Select[Range[4000], (ir = IntegerReverse[#]) != # && PrimeQ[#] && PrimeQ[ir] && (ir2 = IntegerReverse[#, 2]) != # && PrimeQ[ir2] &] (* Amiram Eldar, Aug 23 2021 *)
    Select[Prime[Range[600]],!PalindromeQ[#]&&FromDigits[Reverse[IntegerDigits[#,2]],2]!=#&&AllTrue[{IntegerReverse[#],FromDigits[Reverse[IntegerDigits[#,2]],2]},PrimeQ]&] (* Harvey P. Dale, Oct 13 2022 *)
  • Python
    from sympy import isprime, primerange
    def ok(p):
        s, b = str(p), bin(p)[2:]
        if s == s[::-1] or b == b[::-1]: return False
        return isprime(int(s[::-1])) and isprime(int(b[::-1], 2))
    print(list(filter(ok, primerange(1, 3720)))) # Michael S. Branicky, Aug 24 2021
Showing 1-4 of 4 results.