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

A108382 Primes p such that p's set of distinct digits is {1,3,7}.

Original entry on oeis.org

137, 173, 317, 1373, 1733, 3137, 3371, 7331, 11173, 11317, 11731, 13171, 13177, 13337, 13711, 17137, 17317, 17333, 17377, 17713, 17737, 31177, 31337, 31771, 33317, 33713, 37117, 37171, 37313, 37717, 71317, 71333, 71713, 73133, 73331
Offset: 1

Views

Author

Rick L. Shepherd, Jun 01 2005

Keywords

Crossrefs

Cf. A108383 ({1, 3, 9}), A108384 ({1, 7, 9}), A108385 ({3, 7, 9}), A108386 ({1, 3, 7, 9}), A030096 (Primes whose digits are all odd).

Programs

  • Maple
    S1[1] := {1}: S3[1]:= {3}: S7[1]:= {7}:
    S13[1]:= {}: S17[1]:= {}: S37[1]:={}:
    S137[1]:= {}:
    for n from 2 to 5 do
      S1[n]:= map(t -> 10*t+1, S1[n-1]);
      S3[n]:= map(t -> 10*t+3, S3[n-1]);
      S7[n]:= map(t -> 10*t+7, S7[n-1]);
      S13[n]:= map(t -> 10*t+1, S13[n-1] union S3[n-1]) union
               map(t -> 10*t+3, S13[n-1] union S1[n-1]);
      S17[n]:= map(t -> 10*t+1, S17[n-1] union S7[n-1]) union
               map(t -> 10*t+7, S17[n-1] union S1[n-1]);
      S37[n]:= map(t -> 10*t+3, S37[n-1] union S7[n-1]) union
               map(t -> 10*t+7, S37[n-1] union S3[n-1]);
      S137[n]:= map(t -> 10*t+1, S137[n-1] union S37[n-1]) union
                map(t -> 10*t+3, S137[n-1] union S17[n-1]) union
                map(t -> 10*t+7, S137[n-1] union S13[n-1]);
    od:
    sort(convert(`union`(seq(select(isprime,S137[n]),n=3..5)),list)); # Robert Israel, Jan 16 2019
  • Mathematica
    Select[Prime[Range[7300]],Union[IntegerDigits[#]]=={1,3,7}&] (* Harvey P. Dale, Jun 11 2013 *)

A108383 Primes p such that p's set of distinct digits is {1,3,9}.

Original entry on oeis.org

139, 193, 1193, 1319, 1399, 1913, 1931, 1933, 1993, 3119, 3191, 3319, 3391, 3911, 3919, 3931, 9133, 9311, 9319, 9391, 9931, 11393, 11399, 11933, 11939, 13339, 13399, 13913, 13931, 13933, 13999, 19139, 19319, 19333, 19391, 19913, 19993, 31139
Offset: 1

Views

Author

Rick L. Shepherd, Jun 01 2005

Keywords

Crossrefs

Cf. A108382 ({1, 3, 7}), A108384 ({1, 7, 9}), A108385 ({3, 7, 9}), A108386 ({1, 3, 7, 9}), A030096 (Primes whose digits are all odd).

Programs

  • Mathematica
    Select[(Table[FromDigits/@Tuples[{1,3,9},n],{n,3,5}]//Flatten),PrimeQ[#] && Min[ DigitCount[#,10,{1,3,9}]]>0&] (* Harvey P. Dale, Apr 09 2017 *)

A108384 Primes p such that p's set of distinct digits is {1,7,9}.

Original entry on oeis.org

179, 197, 719, 971, 1979, 1997, 7919, 9719, 9791, 11197, 11719, 11779, 11971, 17191, 17791, 17911, 17971, 17977, 19717, 19777, 19979, 19997, 71119, 71191, 71719, 71917, 71971, 71999, 77191, 77719, 79111, 91711, 91771, 91997, 97117, 97171
Offset: 1

Views

Author

Rick L. Shepherd, Jun 01 2005

Keywords

Crossrefs

Cf. A108382 ({1, 3, 7}), A108383 ({1, 3, 9}), A108385 ({3, 7, 9}), A108386 ({1, 3, 7, 9}), A030096 (Primes whose digits are all odd).

Programs

  • Mathematica
    Flatten[Table[Select[FromDigits/@Select[Tuples[{1,7,9},n],Union[#]=={1,7,9}&],PrimeQ],{n,3,5}]] (* Harvey P. Dale, Feb 15 2016 *)
  • PARI
    lista(nn) = forprime(p=179, nn, if(vecsort(digits(p), , 8)==[1, 7, 9], print1(p, ", "))) \\ Iain Fox, Oct 25 2017

A108385 Primes p such that p's set of distinct digits is {3,7,9}.

Original entry on oeis.org

379, 397, 739, 937, 3739, 3779, 3793, 3797, 7393, 7793, 7933, 7937, 7993, 9337, 9377, 9397, 9733, 9739, 9973, 33739, 33797, 33937, 33997, 37339, 37379, 37397, 37799, 37993, 37997, 39373, 39397, 39733, 39779, 39799, 39937, 39979, 73379, 73939
Offset: 1

Views

Author

Rick L. Shepherd, Jun 01 2005

Keywords

Crossrefs

Cf. A108382 ({1, 3, 7}), A108383 ({1, 3, 9}), A108384 ({1, 7, 9}), A108386 ({1, 3, 7, 9}), A030096 (Primes whose digits are all odd).

Programs

  • Mathematica
    Table[Select[FromDigits/@Select[Tuples[{3,7,9},n],SubsetQ[#,{3,7,9}]&], PrimeQ],{n,3,5}]//Flatten (* Harvey P. Dale, Sep 15 2016 *)

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

A108418 Primes with at least one of each odd digit and no even digits.

Original entry on oeis.org

13597, 13759, 15739, 15937, 15973, 17359, 17539, 19753, 31957, 37159, 37591, 37951, 39157, 51973, 53197, 53719, 53791, 53917, 57139, 57193, 71359, 71593, 73951, 75193, 75391, 75913, 75931, 79153, 79531, 91573, 91753, 95317, 95713, 95731
Offset: 1

Views

Author

Rick L. Shepherd, Jun 02 2005

Keywords

Comments

This is a subsequence of A030096.
No even digits are allowable. Otherwise the first missing terms would be 105379, 105397, 109357, 109537. - Zak Seidov, Nov 24 2013

Crossrefs

Cf. A030096 (Primes whose digits are all odd), A050288 (Pandigital primes), A108386 (Primes p such that p's set of distinct digits is {1, 3, 7, 9}).
Cf. A232447 (even digits are allowable). - Zak Seidov, Nov 24 2013

Programs

  • Mathematica
    Select[Table[Prime[n],{n,10000}],!ContainsAny[IntegerDigits[#],{0,2,4,6,8}]&&ContainsAll[IntegerDigits[#],{1,3,5,7,9}]&] (* James C. McMahon, Mar 05 2024 *)
  • Python
    from sympy import isprime
    from itertools import count, islice, product
    def agen():
        for d in count(5):
            for p in product("13579", repeat=d):
                if set(p) != set("13579"): continue
                t = int("".join(p))
                if isprime(t): yield t
    print(list(islice(agen(), 40))) # Michael S. Branicky, Jul 08 2022

Extensions

Added missing last term with 5 different digits, Carmine Suriano, Jan 14 2011

A158917 Emirps using each of the digits 1, 3, 7, 9 at least once, but no others.

Original entry on oeis.org

3719, 3917, 7193, 9173, 17393, 17939, 19793, 19973, 31799, 37199, 37991, 39371, 39791, 71399, 79319, 91397, 93971, 99173, 99317, 99713, 113797, 117193, 119773, 131797, 133379, 137993, 139397, 171937, 177319, 179173, 179939, 191137, 191173, 193337, 193799, 193937, 199337, 199739
Offset: 1

Views

Author

Lekraj Beedassy, Mar 30 2009

Keywords

Formula

A006567 INTERSECT A108386.

Extensions

137993, 171937, 179939 etc. inserted by R. J. Mathar, Apr 04 2009
Showing 1-8 of 8 results.