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-10 of 11 results. Next

A199329 Primes having only {0, 1, 9} as digits.

Original entry on oeis.org

11, 19, 101, 109, 191, 199, 911, 919, 991, 1009, 1019, 1091, 1109, 1901, 1999, 9001, 9011, 9091, 9109, 9199, 9901, 10009, 10091, 10099, 10111, 10909, 11119, 11909, 19001, 19009, 19919, 19991, 90001, 90011, 90019, 90191, 90199, 90901, 90911, 91009, 91019, 91099, 91199, 91909, 99109, 99119, 99191, 99901, 99991
Offset: 1

Views

Author

M. F. Hasler, Nov 05 2011

Keywords

Crossrefs

Programs

  • Mathematica
    Select[FromDigits/@Tuples[{0,1,9},5],PrimeQ] (* Harvey P. Dale, Dec 10 2016 *)
  • PARI
    A199329(n=50,show=0,L=[0,1,9])={for(d=1,1e9,my(t,u=vector(d,i,10^(d-i))~);forvec(v=vector(d,i,[1+!(L[1]||(i>1&&iM. F. Hasler, Jul 25 2015

A036953 Primes having only {0, 1, 2} as digits.

Original entry on oeis.org

2, 11, 101, 211, 1021, 1201, 2011, 2111, 2221, 10111, 10211, 12011, 12101, 12211, 20011, 20021, 20101, 20201, 21001, 21011, 21101, 21121, 21211, 21221, 22111, 101021, 101111, 101221, 102001, 102101, 102121, 110221, 111121, 111211, 112111
Offset: 1

Views

Author

Patrick De Geest, Jan 04 1999

Keywords

Comments

Number of n-digit terms d(n) = (1, 1, 2, 5, 16, 34, 76, 194, 543, 1469, 4094, 11017, ...); e.g., there are five 4-digit terms: 1021, 1201, 2011, 2111, 2221, hence d(4) = 5. - Zak Seidov, Jun 30 2013
Also, primes in A007089. - M. F. Hasler, Jul 25 2015

Crossrefs

Programs

  • Mathematica
    Select[FromDigits/@Tuples[{0,1,2},6],PrimeQ] (* Harvey P. Dale, Jul 11 2017 *)
  • PARI
    lista(n) = {forprime(p=2, n, if (vecmax(digits(p)) <= 2, print1(p, ", ")))} \\ Michel Marcus, Aug 02 2014
    
  • PARI
    A036953={(n,show=0)->for(d=1,1e9,my(u=vector(d,i,10^(d-i))~);forvec(v=vector(d,i,if(i>1,if(iM. F. Hasler, Jul 25 2015
  • Python
    from gmpy2 import digits
    from sympy import isprime
    [int(digits(n,3)) for n in range(1000) if isprime(int(digits(n,3)))] # Chai Wah Wu, Jul 31 2014
    

Extensions

Edited by M. F. Hasler, Jul 25 2015

A260266 Primes having only {0, 1, 4} as digits.

Original entry on oeis.org

11, 41, 101, 401, 4001, 4111, 4441, 10111, 10141, 11411, 14011, 14401, 14411, 40111, 41011, 41141, 41411, 44041, 44101, 44111, 100411, 101111, 101141, 101411, 110441, 114001, 114041, 140111, 140401, 140411, 141041, 141101, 400441, 401101, 401411, 404011
Offset: 1

Views

Author

Vincenzo Librandi, Jul 22 2015

Keywords

Comments

A020449 and A020452 are subsequences.
All terms end with a digit "1". - M. F. Hasler, Jul 26 2015

Crossrefs

Primes that contain only digits among {1,4,k}: this sequence (k=0), A260267 (k=2), A199341 (k=3), A260268 (k=5), A260269 (k=6), A079651 (k=7), A260270 (k=8), A260271 (k=9).

Programs

  • Magma
    [p: p in PrimesUpTo(5*10^5) | Set(Intseq(p)) subset [1, 4, 0]];
    
  • Mathematica
    Select[Prime[Range[4 10^4]], Complement[IntegerDigits[#], {1, 4, 0}]=={} &]
  • PARI
    A260266(n=50,show=0)={for(d=1,1e9,my(t,u=vector(d,i,10^(d-i))~);forvec(v=vector(d,i,[i==1||i==d,1+(iM. F. Hasler, Jul 25 2015

A199327 Primes having only {0, 1, 7} as digits.

Original entry on oeis.org

7, 11, 17, 71, 101, 107, 701, 1117, 1171, 1777, 7001, 7177, 7717, 10007, 10111, 10177, 10711, 10771, 11071, 11117, 11171, 11177, 11701, 11717, 11777, 17011, 17077, 17107, 17117, 17707, 70001, 70111, 70117, 70177, 70717, 71011, 71171, 71707, 71711, 71777, 77017, 77101, 77171, 77711, 101107, 101111, 101117
Offset: 1

Views

Author

M. F. Hasler, Nov 05 2011

Keywords

Crossrefs

Programs

  • Magma
    [p: p in PrimesUpTo(80000) | Intseq(p) subset {0,1,7}]; // Vincenzo Librandi, Jan 16 2020
  • Mathematica
    f[i_,nn_]:=Select[Flatten[Table[FromDigits/@(Join[{i},#]&/@Tuples[ {0,1,7}, n]), {n,0,nn}]],PrimeQ]; Union[Join[f[1,6],f[7,6]]] (* Harvey P. Dale, Nov 19 2011 *)
    Select[Prime[Range[2 10^4]], Complement[IntegerDigits[#], {0, 1, 7}]=={}&] (* Vincenzo Librandi, Jan 16 2020 *)
  • PARI
    a(n,list=0,L=[0,1,7])={for(d=1,1e9,my(t,u=vector(d,i,10^(d-i))~);forvec(v=vector(d,i,[1+!(L[1]||(i>1&&iM. F. Hasler, Jul 26 2015
    

A217039 Primes having only {4, 5, 7} as digits.

Original entry on oeis.org

5, 7, 47, 457, 547, 557, 577, 757, 4447, 4457, 4547, 5477, 5557, 7457, 7477, 7547, 7577, 7757, 44777, 45557, 45757, 47777, 54547, 54577, 55457, 55547, 57457, 57557, 74747, 75557, 75577, 77447, 77477, 77557, 77747, 444547, 444557, 445447, 445477, 445747, 447757
Offset: 1

Views

Author

Jonathan Vos Post, Sep 24 2012

Keywords

Comments

These are the primes in A214584. Primes whose numerals are all written (san serif) with at least one right or acute angle.

Crossrefs

Programs

  • Magma
    [p: p in PrimesUpTo(450000) | Intseq(p) subset [4,5,7]]; // Bruno Berselli, Sep 25 2012
    
  • Mathematica
    Select[Flatten[Table[FromDigits/@Tuples[{4,5,7},n],{n,6}]],PrimeQ] (* Bruno Berselli, Sep 25 2012 *)
  • PARI
    A217039(n=50,show=0,L=[4,5,7])={for(d=1,1e9, my(t, u=vector(d,i,10^(d-i))~); forvec(v=vector(d,i,[if(i==d&&d>1,3/*must end in 7*/,1), #L]), ispseudoprime(t=vecextract(L, v)*u)||next; show&&print1(t", "); n--||return(t)))} \\ Syntax updated for newer PARI versions by M. F. Hasler, Jul 25 2015

Formula

A000040 INTERSECTION A214584.

A261434 Primes having only {0, 3, 8} as digits.

Original entry on oeis.org

3, 83, 383, 883, 3083, 3803, 3833, 8803, 30803, 33083, 38083, 38303, 38333, 38803, 38833, 80803, 80833, 83003, 83383, 83833, 88003, 88883, 303803, 308003, 308303, 308333, 308383, 330383, 333383, 333803, 338033, 338383, 338803, 380333, 380383, 380803, 383083
Offset: 1

Views

Author

Vincenzo Librandi, Aug 18 2015

Keywords

Comments

A020464 is a subsequence.

Crossrefs

Cf. Primes that contain only the digits (0,3,k): A260044 (k=1), A260125 (k=2), A199340 (k=4), A260223 (k=5), A260378 (k=7), this sequence (k=8).

Programs

  • Magma
    [p: p in PrimesUpTo(2*10^6) | Set(Intseq(p)) subset [0, 3, 8]];
  • Mathematica
    Select[Prime[Range[2 10^5]], Complement[IntegerDigits[#], {0, 3, 8}] == {} &]
    Select[FromDigits/@Tuples[{0,3,8},6],PrimeQ] (* Harvey P. Dale, Jul 10 2017 *)

A111488 Primes having only {0, 1, 3, 6} as digits.

Original entry on oeis.org

3, 11, 13, 31, 61, 101, 103, 113, 131, 163, 311, 313, 331, 601, 613, 631, 661, 1013, 1031, 1033, 1061, 1063, 1103, 1163, 1301, 1303, 1361, 1601, 1613, 1663, 3001, 3011, 3061, 3163, 3301, 3313, 3331, 3361, 3613, 3631, 6011, 6101, 6113, 6131, 6133, 6163
Offset: 1

Views

Author

Jonathan Vos Post, Nov 15 2005

Keywords

Comments

Includes all repunit primes (A004022). Conjecture: an infinite sequence. Note twin primes: (11, 13), (101, 103), (311, 313), (1031, 1033), (1061, 1063), (1301, 1303), (6131, 6133), (10301, 10303), (10331, 10333), (13001, 13003).
In other words, primes with digits in the set {0,1,3,6}. - M. F. Hasler, Jul 25 2015
The number of 1's in the representation must be either 1 or 2 (mod 3), because otherwise the number would be divisible by 3 (and therefore composite). The only exception is the 3 itself. This excludes basically members of A038603. - R. J. Mathar, Jul 25 2015

Crossrefs

Programs

  • Maple
    f:= proc(x) local L,p;
      L:= subs([3=6,2=3],convert(x,base,4));
      p:= add(L[i]*10^(i-1),i=1..nops(L));
      if isprime(p) then p fi
    end proc:
    map(f, [$1..4^4]); # Robert Israel, Dec 18 2018
  • Mathematica
    Select[Prime@ Range@ 1000, SubsetQ[{0, 1, 3, 6}, IntegerDigits@ #] &] (* Michael De Vlieger, Jul 25 2015 *)
  • PARI
    A111488={(n, show=0, L=[0,1,3,6])->my(t); for(d=1,1e9,u=vector(d, i, 10^(d-i))~; forvec(v=vector(d,i,[1+(i==1&&!L[1]), #L]), ispseudoprime(t=vector(d, i, L[v[i]])*u)||next; show&print1(t", "); n--||return(t)))} \\ M. F. Hasler, Jul 25 2015

Extensions

Corrected by Ray Chandler, Nov 19 2005
Name changed by Sean A. Irvine, Jul 21 2025

A386023 Primes having only {0, 1, 3, 4} as digits.

Original entry on oeis.org

3, 11, 13, 31, 41, 43, 101, 103, 113, 131, 311, 313, 331, 401, 431, 433, 443, 1013, 1031, 1033, 1103, 1301, 1303, 1433, 3001, 3011, 3041, 3301, 3313, 3331, 3343, 3413, 3433, 4001, 4003, 4013, 4111, 4133, 4441, 10103, 10111, 10133, 10141, 10301, 10303, 10313, 10331
Offset: 1

Views

Author

Jason Bard, Jul 14 2025

Keywords

Crossrefs

Subsequence of A036956.
Supersequence of A199341, A260044, A260266.

Programs

  • Magma
    [p: p in PrimesUpTo(10^6) | Set(Intseq(p)) subset [0, 1, 3, 4]];
    
  • Mathematica
    Select[FromDigits /@ Tuples[{0, 1, 3, 4}, n], PrimeQ]
  • PARI
    primes_with(, 1, [0, 1, 3, 4]) \\ uses function in A385776
  • Python
    print(list(islice(primes_with("0134"), 41))) # uses function/imports in A385776
    

A386024 Primes having only {0, 1, 3, 5} as digits.

Original entry on oeis.org

3, 5, 11, 13, 31, 53, 101, 103, 113, 131, 151, 311, 313, 331, 353, 503, 1013, 1031, 1033, 1051, 1103, 1151, 1153, 1301, 1303, 1511, 1531, 1553, 3001, 3011, 3301, 3313, 3331, 3511, 3533, 5003, 5011, 5051, 5101, 5113, 5153, 5303, 5333, 5351, 5501, 5503, 5531, 10103
Offset: 1

Views

Author

Jason Bard, Jul 14 2025

Keywords

Crossrefs

Subsequence of A036958.
Supersequence of A199325, A260044, A260224.

Programs

  • Magma
    [p: p in PrimesUpTo(10^6) | Set(Intseq(p)) subset [0, 1, 3, 5]];
    
  • Mathematica
    Select[FromDigits /@ Tuples[{0, 1, 3, 5}, n], PrimeQ]
  • PARI
    primes_with(, 1, [0, 1, 3, 5]) \\ uses function in A385776
  • Python
    print(list(islice(primes_with("0135"), 41))) # uses function/imports in A385776
    

A386025 Primes having only {0, 1, 3, 7} as digits.

Original entry on oeis.org

3, 7, 11, 13, 17, 31, 37, 71, 73, 101, 103, 107, 113, 131, 137, 173, 307, 311, 313, 317, 331, 337, 373, 701, 733, 773, 1013, 1031, 1033, 1103, 1117, 1171, 1301, 1303, 1307, 1373, 1733, 1777, 3001, 3011, 3037, 3137, 3301, 3307, 3313, 3331, 3371, 3373, 3701, 3733
Offset: 1

Views

Author

Jason Bard, Jul 14 2025

Keywords

Crossrefs

Supersequence of A199327, A260044, A260379.

Programs

  • Magma
    [p: p in PrimesUpTo(10^6) | Set(Intseq(p)) subset [0, 1, 3, 7]];
    
  • Mathematica
    Select[FromDigits /@ Tuples[{0, 1, 3, 7}, n], PrimeQ]
  • PARI
    primes_with(, 1, [0, 1, 3, 7]) \\ uses function in A385776
  • Python
    print(list(islice(primes_with("0137"), 41))) # uses function/imports in A385776
    
Showing 1-10 of 11 results. Next