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.

Previous Showing 11-20 of 49 results. Next

A107845 Transposable-digit primes: Primes such that if any single pair of adjacent digits is transposed the result is a prime.

Original entry on oeis.org

2, 3, 5, 7, 11, 13, 17, 31, 37, 71, 73, 79, 97, 113, 131, 137, 179, 199, 277, 311, 331, 337, 373, 379, 397, 419, 491, 577, 613, 733, 811, 877, 911, 919, 977, 991, 1013, 1031, 1091, 1117, 1213, 1231, 1579, 1777, 1811, 1999, 2113, 2131, 2399, 2411, 2677, 2699, 2719
Offset: 1

Views

Author

Rick L. Shepherd, May 24 2005

Keywords

Comments

A single transposition error (of decimal digits) when recording or communicating such a prime still results in a prime (possibly the same prime). A003459 and A004022 (its subsequence) are subsequences. A003459 is also a subsequence of A068652.

Examples

			137 is a term because it is prime and 173 and 317 are also prime.
173 is not a term because 713 is not prime (even though 173 and 137 are prime). {Hence none of 137,173,317,371,713,731 is a term of A003459.}
3119 is a term because it is prime and 1319 and 3191 are primes.
As 3119, 1193, 1931 and 9311 are all prime, 3119 is also a term of A068652.
Finally, although 1913 is also prime, neither 1139, 1391, 3911, 9113, nor 9131 is prime so 3119's twelve total permutations are not terms of A003459.
		

Crossrefs

Cf. A003459 (absolute primes), A004022 (repunit primes), A068652 (every cyclic permutation is prime).

Programs

  • Mathematica
    swap[lst_List, i_Integer] := Block[{lsu = lst}, ReplacePart[ lsu, {i -> lsu[[i + 1]], i + 1 -> lsu[[i]]}]]; fQ[n_] := Block[{id = IntegerDigits@ n, l = Floor@ Log10@ n}, And @@ Table[ PrimeQ@ FromDigits@ swap[id, j], {j, l}] == True]; Select[ Prime@ Range@ 500, fQ] (* Robert G. Wilson v, Nov 29 2014 *)
  • PARI
    eva(n) = subst(Pol(n), x, 10)
    switchdigits(v, pos) = my(vt=v[pos]); v[pos]=v[pos+1]; v[pos+1]=vt; v
    is(n) = my(d=digits(n)); for(k=1, #d-1, if(!ispseudoprime(eva(switchdigits(d, k))), return(0))); 1
    forprime(p=1, , if(is(p), print1(p, ", "))) \\ Felix Fröhlich, Sep 21 2019

Extensions

Offset changed from 0 to 1 by Felix Fröhlich, Sep 21 2019

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

A108389 Transmutable primes with four distinct digits.

Original entry on oeis.org

133999337137, 139779933779, 173139331177, 173399913979, 177793993177, 179993739971, 391331737931, 771319973999, 917377131371, 933971311913, 997331911711, 1191777377177, 9311933973733, 9979333919939, 19979113377173, 31997131171111, 37137197179931, 37337319113911
Offset: 1

Views

Author

Rick L. Shepherd, Jun 02 2005

Keywords

Comments

This sequence is a subsequence of A108386 and of A108388. See the latter for the definition of transmutable primes and many more comments. Are any terms here doubly-transmutable also; i.e., terms of A108387? Palindromic too? Terms also of some other sequences cross-referenced below? a(7)=771319973999 is also a reversible prime (emirp). a(12)=9311933973733 also has the property that simultaneously removing all its 1's (93933973733), all its 3s (9119977) and all its 9s (3113373733) result in primes (but removing all 7s gives 93119339333=43*47*59*83*97^2, so a(12) is not also a term of A057876). Any additional terms have 14 or more digits.

Examples

			a(0)=133999337137 is the smallest transmutable prime with four distinct digits (1,3,7,9):
exchanging all 1's and 3's: 133999337137 ==> 311999117317 (prime),
exchanging all 1's and 7's: 133999337137 ==> 733999331731 (prime),
exchanging all 1's and 9's: 133999337137 ==> 933111337937 (prime),
exchanging all 3's and 7's: 133999337137 ==> 177999773173 (prime),
exchanging all 3's and 9's: 133999337137 ==> 199333997197 (prime) and
exchanging all 7's and 9's: 133999337137 ==> 133777339139 (prime).
No smaller prime with four distinct digits transmutes into six other primes.
		

Crossrefs

Cf. A108386 (Primes p such that p's set of distinct digits is {1, 3, 7, 9}), A108388 (transmutable primes), A083983 (transmutable primes with two distinct digits), A108387 (doubly-transmutable primes), A006567 (reversible primes), A002385 (palindromic primes), A068652 (every cyclic permutation is prime), A107845 (transposable-digit primes), A003459 (absolute primes), A057876 (droppable-digit primes).

Extensions

a(14) and beyond from Michael S. Branicky, Dec 15 2023

A129338 Absolute primes, alternative definition: every permutation of digits is a prime and there are at least two different digits.

Original entry on oeis.org

13, 17, 31, 37, 71, 73, 79, 97, 113, 131, 199, 311, 337, 373, 733, 919, 991
Offset: 1

Views

Author

M. F. Hasler, Mar 26 2008

Keywords

Comments

No further terms through the 50000th prime, i.e., through 611953. - Harvey P. Dale, May 19 2012.

Crossrefs

See the main entry A003459 for the usual definition.

Programs

  • Mathematica
    Select[Prime[Range[5,170]],And@@PrimeQ[FromDigits/@Permutations[ IntegerDigits[#]]]&] (* Harvey P. Dale, Oct 03 2011 *)

A376500 Primes that contain at least one even digit and two different odd digits where any permutation of the odd digits leaving the even digits fixed produces a prime.

Original entry on oeis.org

107, 149, 167, 239, 293, 347, 389, 419, 491, 613, 619, 631, 691, 701, 709, 743, 761, 769, 907, 941, 967, 983, 1009, 1013, 1019, 1031, 1049, 1063, 1091, 1123, 1223, 1229, 1249, 1289, 1321, 1429, 1487, 1499, 1609, 1627, 1669, 1823, 1847, 2113, 2131, 2143, 2237, 2239, 2273, 2293, 2309, 2311, 2341
Offset: 1

Views

Author

Enrique Navarrete, Sep 25 2024

Keywords

Comments

The primes in the sequence cannot contain 5.

Examples

			1013 is a term since the permutations of the odd digits that leave the even digits fixed give 1031 and 3011, which are also prime.
		

Crossrefs

Programs

  • Maple
    filter:= proc(n) local L,oddi,eveni,xeven,i;
     if not isprime(n) then return false fi;
     L:= convert(n,base,10);
     if member(5,L) then return false fi;
     oddi,eveni:= selectremove(t -> L[t]::odd,[$1..nops(L)]);
     if nops(eveni) = 0 or nops(convert(L[oddi],set))<2 then return false fi;
     xeven:= add(10^(i-1)*L[i],i=eveni);
     andmap(t -> isprime(xeven+add(10^(oddi[i]-1)*L[t[i]],i=1..nops(oddi))), combinat:-permute(oddi))
    end proc:
    select(filter, [seq(i,i=3..10000,2)]); # Robert Israel, Oct 23 2024

A376501 Primes that contain at least two different even digits where any permutation of the even digits leaving the odd digits fixed produces a prime. See comments for the treatment of 0.

Original entry on oeis.org

241, 281, 283, 401, 421, 461, 463, 467, 601, 607, 641, 643, 647, 683, 809, 821, 823, 863, 1021, 1049, 1061, 1069, 1201, 1249, 1283, 1409, 1429, 1487, 1601, 1609, 1823, 1847, 2011, 2027, 2039, 2161, 2207, 2347, 2389, 2411, 2417, 2441, 2459, 2473, 2503, 2543, 2617, 2657, 2671, 2677, 2699, 2707
Offset: 1

Views

Author

Enrique Navarrete, Sep 25 2024

Keywords

Comments

Primes for which permutations described in the name produce primes with leading 0s are in the sequence but the generated primes with leading 0s are not. For example, a transposition in 401 produces 041, hence 401 is in the sequence but 41 is not.

Examples

			2027, 2207 are primes and 227 is prime with a leading 0 generated by permuting even digits in either 2027 or 2207.  Hence 2027 and 2207 are in the sequence but 227 is not due to the leading 0.
6067, 6607 are primes but 667 generated by permuting even digits in either 6067 or 6607 is not prime, hence by name, neither number is in the sequence.
		

Crossrefs

Programs

  • Maple
    filter:= proc(n) local L,oddi,eveni,xodd,i;
     if not isprime(n) then return false fi;
     L:= convert(n,base,10);
     oddi,eveni:= selectremove(t -> L[t]::odd,[$1..nops(L)]);
     if nops(convert(L[eveni],set))<2 then return false fi;
     xodd:= add(10^(i-1)*L[i],i=oddi);
     andmap(t -> isprime(xodd+add(10^(eveni[i]-1)*L[t[i]],i=1..nops(eveni))), combinat:-permute(eveni))
    end proc:
    select(filter, [seq(i,i=3..10000,2)]); # Robert Israel, Oct 23 2024

A085300 a(n) is the least prime x such that when reversed it is a power of prime(n).

Original entry on oeis.org

2, 3, 5, 7, 11, 31, 71, 163, 18258901387, 90367894271, 13, 73, 1861, 344800741, 34351783286302805384336021, 940315563074788471, 1886172359328147919771, 14854831
Offset: 1

Views

Author

Labos Elemer, Jun 24 2003

Keywords

Comments

A006567 (after rearranging terms) and A002385 are subsequences. - Chai Wah Wu, Jun 02 2016

Examples

			a(14)=344800741 means that 147008443=43^5=p(14)^5, where 5 is the smallest such exponent;
a(19) has 82 decimal digits and if reversed equals 39th power of p(19)=67.
		

Crossrefs

Programs

  • Python
    from sympy import prime, isprime
    def A085300(n):
        p = prime(n)
        q = p
        while True:
            m = int(str(q)[::-1])
            if isprime(m):
                return(m)
            q *= p # Chai Wah Wu, Jun 02 2016

A086051 Nontrivial numbers which are prime, contain no zero digits and yield another prime when their digits are sorted in ascending order.

Original entry on oeis.org

31, 71, 73, 97, 131, 173, 193, 197, 271, 293, 311, 317, 373, 397, 419, 439, 491, 547, 571, 593, 617, 647, 659, 673, 719, 727, 733, 739, 743, 751, 757, 761, 839, 919, 937, 941, 947, 953, 971, 983, 991, 1171, 1213, 1231, 1291, 1297, 1321, 1327, 1429, 1549
Offset: 1

Views

Author

Chuck Seggelin, Jul 07 2003

Keywords

Comments

Primes with digits already in ascending order (like 13 and 2357) are trivial cases and are therefore excluded.

Examples

			a(1)=31 because an ascending sort of 31's digits yields 13 which is also prime. a(100)=3527 because an ascending sort of 3527's digits yields 2357 which is also prime.
		

Crossrefs

Programs

  • Mathematica
    sdaQ[n_]:=Module[{idn=IntegerDigits[n],srt},srt=Sort[idn];!MemberQ[ idn,0] &&idn!=srt&&PrimeQ[FromDigits[srt]]]; Select[Prime[Range[300]],sdaQ] (* Harvey P. Dale, Dec 14 2014 *)

A272106 Absolute primes in base 3: every permutation of digits in base 3 is a prime (only the smallest representatives of the permutation classes are shown).

Original entry on oeis.org

2, 5, 13, 1093, 797161, 3754733257489862401973357979128773, 6957596529882152968992225251835887181478451547013
Offset: 1

Views

Author

Chai Wah Wu, Apr 20 2016

Keywords

Comments

For n <= 7, only a(2) = 5 is not a repunit in base 3. Supersequence of A076481. Base 3 analog of A258706.

Crossrefs

Previous Showing 11-20 of 49 results. Next