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-3 of 3 results.

A108387 Doubly-transmutable primes: primes such that simultaneously exchanging pairwise all occurrences of any two disjoint pairs of distinct digits results in a prime.

Original entry on oeis.org

113719, 131797, 139177, 139397, 193937, 313979, 317179, 317399, 331937, 371719, 739391, 779173, 793711, 793931, 797131, 917173, 971713, 971933, 979313, 997391, 1111793, 3333971, 7777139, 9999317, 13973731, 31791913, 79319197, 97137379
Offset: 1

Views

Author

Rick L. Shepherd, Jun 02 2005

Keywords

Comments

By my definition of (a nontrivial) transmutable prime, each digit of each term must be capable of being an ending digit of a prime, so this sequence is a subsequence of A108387, primes p such that p's set of distinct digits is {1,3,7,9}. The repunit primes (A004022), which would otherwise trivially be (doubly-)transmutable and primes whose distinct digits are other proper subsets of {1,3,7,9} are excluded here by the two-disjoint-pair condition.

Examples

			a(0) = 113719 as this is the first prime having four distinct digits and such that all three simultaneous pairwise exchanges of all distinct digits as shown below 'transmutate' the original prime into other primes:
(1,3) and (7,9): 113719 ==> 331937 (prime),
(1,7) and (3,9): 113719 ==> 779173 (prime),
(1,9) and (3,7): 113719 ==> 997391 (prime).
		

Crossrefs

Cf. A108387, A108388 (transmutable primes), A108389 (transmutable primes with four distinct digits), A107845 (transposable-digit primes), A003459 (absolute primes).

Programs

  • Maple
    N:= 100: # to get a(1) to a(N)
    R:= NULL: count:= 0:
    S[1] := [0=1,1=3,2=7,3=9]:
    S[2] := [0=3,1=1,2=9,3=7]:
    S[3] := [0=7,1=9,2=1,3=3]:
    S[4] := [0=9,1=7,2=3,3=1]:
    g:= L -> add(L[i]*10^(i-1),i=1..nops(L)):
    for d from 6 while count < N do
    for n from 4^d to 2*4^d-1 while count < N do
      L:= convert(n,base,4)[1..-2];
      if nops(convert(L,set)) < 4 then next fi;
      if andmap(isprime,[seq(g(subs(S[i],L)),i=1..4)]) then
        R:= R, g(subs(S[1],L)); count:= count+1;
      fi
    od od:
    R; # Robert Israel, Jul 27 2020

Extensions

Offset changed by Robert Israel, Jul 27 2020

A108388 Transmutable primes: Primes with distinct digits d_i, i=1,m (2<=m<=4) such that simultaneously exchanging all occurrences of any one pair (d_i,d_j), i<>j results in a prime.

Original entry on oeis.org

13, 17, 31, 37, 71, 73, 79, 97, 113, 131, 179, 191, 199, 313, 331, 337, 773, 911, 919, 1171, 1933, 3391, 7717, 9311, 11113, 11119, 11177, 11717, 11933, 33199, 33331, 77171, 77711, 77713, 79999, 97777, 99991, 113111, 131111, 131113, 131171, 131311
Offset: 1

Views

Author

Rick L. Shepherd, Jun 02 2005

Keywords

Comments

a(n) is a term iff a(n) is prime and binomial(m,2) 'transmutations' (see example) of a(n) are different primes. A083983 is the subsequence for m=2: one transmutation (The author of A083983, Amarnath Murthy, calls the result of such a digit-exchange a self-complement. {Because I didn't know until afterwards that this sequence was a generalization of A083983 and as this generalization always leaves some digits unchanged for m>2, I've chosen different terminology.}). A108389 ({1,3,7,9}) is the subsequence for m=4: six transmutations. Each a(n) corresponding to m=3 (depending upon its set of distinct digits) and having three transmutations is also a member of A108382 ({1,3,7}), A108383 ({1,3,9}), A108384 ({1,7,9}), or A108385 ({3,7,9}). The condition m>=2 only eliminates the repunit (A004022) and single-digit primes. The condition m<=4 is not a restriction because if there were more distinct digits, they would include even digits or the digit 5, in either case transmuting into a composite number. Some terms such as 1933 are reversible primes ("Emirps": A006567) and the reverse is also transmutable. The transmutable prime 3391933 has three distinct digits and is also a palindromic prime (A002385). The smallest transmutable prime having four distinct digits is A108389(0) = 133999337137 (12 digits).

Examples

			179 is a term because it is prime and its three transmutations are all prime:
exchanging ('transmuting') 1 and 7: 179 ==> 719 (prime),
exchanging 1 and 9: 179 ==> 971 (prime) and
exchanging 7 and 9: 179 ==> 197 (prime).
(As 791 and 917 are not prime, 179 is not a term of A068652 or A003459 also.).
Similarly, 1317713 is transmutable:
exchanging all 1's and 3s: 1317713 ==> 3137731 (prime),
exchanging all 1's and 7s: 1317713 ==> 7371173 (prime) and
exchanging all 3s and 7s: 1317713 ==> 1713317 (prime).
		

Crossrefs

Cf. A108382, A108383, A108384, A108385, A108386, A108389 (transmutable primes with four distinct digits), A083983 (transmutable primes with two distinct digits), A108387 (doubly-transmutable primes), A006567 (reversible primes), A002385 (palindromic primes), A068652 (every cyclic permutation is prime), A003459 (absolute primes).

Programs

  • Python
    from gmpy2 import is_prime
    from itertools import combinations, count, islice, product
    def agen(): # generator of terms
        for d in count(2):
            for p in product("1379", repeat=d):
                p, s = "".join(p), sorted(set(p))
                if len(s) == 1: continue
                if is_prime(t:=int(p)):
                    if all(is_prime(int(p.translate({ord(c):ord(d), ord(d):ord(c)}))) for c, d in combinations(s, 2)):
                        yield t
    print(list(islice(agen(), 50))) # Michael S. Branicky, Dec 15 2023

A109093 Fully-transmutable primes: Transmutable primes such that each transmutation is itself a transmutable prime (A108388).

Original entry on oeis.org

139119131, 193113191, 319339313, 391331393, 913993919, 931991939, 1319999199391, 1913333133931, 3139999399193, 3931111311913, 9193333933139, 9391111911319, 11333911193113, 11999311139119, 33111933391331
Offset: 0

Views

Author

Rick L. Shepherd, Jun 18 2005

Keywords

Comments

See the definitions of "transmutable" and "transmutation" in A108388. Some primes with two distinct digits, namely all terms of A083983, can be considered trivially fully-transmutable. This subsequence of A108388 considers only transmutable primes with more distinct digits. These are primes such that all permutations of assignments of their distinct digits to their shared digit pattern produces primes. (Contrast this with the absolute primes, A003459, where all permutations of the digits themselves produce primes.). Fully-transmutable primes with three distinct digits occur in sets of 3! = 6. Fully-transmutable primes with four distinct digits, if any, would occur in sets of 4! = 24 and would also be a subsequence of A108389.

Examples

			The first six terms share the digit pattern d1 d2 d3 d1 d1 d3 d1 d2 d1. Each of these terms is a (9-digit) prime corresponding to one of the 3! = 6 bijective mappings of {1,3,9} onto {d1,d2,d3}. There are no other such primes with nine or fewer digits.
		

Crossrefs

Cf. A108388 (transmutable primes), A083983 (transmutable primes with two distinct digits), A108389 (transmutable primes with four distinct digits), A003459 (absolute primes), A108387 (doubly-transmutable primes).
Showing 1-3 of 3 results.