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 30 results. Next

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

Original entry on oeis.org

5, 11, 101, 151, 1051, 1151, 1511, 5011, 5051, 5101, 5501, 10111, 10151, 10501, 11551, 15101, 15511, 15551, 50051, 50101, 50111, 50551, 51001, 51151, 51511, 51551, 55001, 55051, 55501, 55511, 100151, 100501, 100511, 101051, 101111, 101501, 110051, 110501, 115001, 115151, 150001, 150011, 150151, 150551
Offset: 1

Views

Author

M. F. Hasler, Nov 05 2011

Keywords

Crossrefs

Programs

  • Magma
    [p: p in PrimesUpTo(160000) | Set(Intseq(p)) subset [0, 1, 5]]; // Vincenzo Librandi, Apr 22 2014
  • Maple
    N:= 10000: # to get the first N terms
    count:= 0:
    allowed:= {0,1,5}:
    nallowed:= nops(allowed):
    subst:= seq(i=allowed[i+1],i=0..nallowed-1):
    for d from 0 while count < N do
      for x1 from 1 to nallowed-1 while count < N do
        for t from 0 to nallowed^d-1 while count < N do
          L:= subs(subst,convert(x1*nallowed^d+t,base,nallowed));
          X:= add(L[i]*10^(i-1),i=1..d+1);
          if isprime(X) then
              count:= count+1;
              A[count]:= X;
          fi
    od od od:
    seq(A[n],n=1..N); # Robert Israel, Apr 20 2014
  • Mathematica
    Select[FromDigits/@Tuples[{0,1,5},6],PrimeQ] (* Harvey P. Dale, Jul 23 2021 *)
  • PARI
    L=[0,1,5];for(d=1,6,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)&print1(t",")))  /* see A199327 for a function a(n) */
    

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

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

Original entry on oeis.org

3, 43, 433, 443, 3343, 3433, 4003, 30403, 33343, 33403, 34033, 34303, 34403, 40343, 40433, 43003, 43403, 300043, 300343, 304033, 304303, 304433, 330433, 333433, 334043, 334333, 334403, 343303, 343333, 343433, 400033, 403003, 403043, 403433, 430303, 430333
Offset: 1

Views

Author

M. F. Hasler, Nov 05 2011

Keywords

Comments

All terms end in '3'. This could be used to speed up the given program.
A020461 is a subsequence. - Vincenzo Librandi, Jul 23 2015

Crossrefs

Cf. Primes that contain only the digits (3,4,k): this sequence (k=0), A199341 (k=1), A199342 (k=2), A199345 (k=5), A199346 (k=6), A199347 (k=7), A199348 (k=8), A199349 (k=9).

Programs

  • Magma
    [p: p in PrimesUpTo(5*10^5) | Set(Intseq(p)) subset [3, 4, 0]]; // Vincenzo Librandi, Jul 23 2015
    
  • Mathematica
    Select[Prime[Range[5 10^4]], Complement[IntegerDigits[#], {3, 4, 0}]=={} &] (* Vincenzo Librandi, Jul 23 2015 *)
    Select[FromDigits/@Tuples[{0,3,4},6],PrimeQ] (* Harvey P. Dale, Mar 21 2020 *)
    Select[10#+3&/@FromDigits/@Tuples[{0,3,4},5],PrimeQ] (* Harvey P. Dale, May 02 2022 *)
  • PARI
    a(n, list=0, L=[0, 3, 4], reqpal=0)={my(t); for(d=1, 1e9, u=vector(d, i, 10^(d-i))~; forvec(v=vector(d, i, [1+(i==1&!L[1]), #L]), isprime(t=vector(d, i, L[v[i]])*u)||next; reqpal && !isprime(A004086(t)) && next; list && print1(t", "); n--||return(t)))} \\ Syntax updated for current PARI version. - M. F. Hasler, Jul 25 2015
    
  • PARI
    {forprime(p=3,1e6,p%10==3&&!setminus(Set(digits(p)),[3,4])&&print1(p","))} \\ [0] evaluates to false. - M. F. Hasler, Jul 25 2015

A061247 Primes having only {0, 1, 8} as digits.

Original entry on oeis.org

11, 101, 181, 811, 881, 1181, 1801, 1811, 8011, 8081, 8101, 8111, 10111, 10181, 11801, 18181, 80111, 81001, 81101, 81181, 88001, 88801, 88811, 100801, 100811, 101081, 101111, 108011, 108881, 110881, 118081, 118801, 180001, 180181, 180811
Offset: 1

Views

Author

Amarnath Murthy, Apr 23 2001

Keywords

Comments

The intersection with A007500 is listed in A199328. - M. F. Hasler, Nov 05 2011

Examples

			a(6) = 1801, 1801 is a prime and consists of only 1, 8 and 0.
		

Crossrefs

Programs

  • Magma
    [NthPrime(n): n in [1..2*10^4] | forall{d: d in Intseq(NthPrime(n)) | d in [0, 1, 8]}]; // Vincenzo Librandi, May 15 2019
  • Maple
    N:= 1000: # to get the first N entries
    count:= 0:
    allowed:= {0,1,8}:
    nallowed:= nops(allowed):
    subst:= seq(i=allowed[i+1],i=0..nallowed-1);
    for d from 1 while count < N do
      for x1 from 1 to nallowed-1 while count < N do
        for t from 0 to nallowed^d-1  while count < N do
          L:= subs(subst,convert(x1*nallowed^d+t,base,nallowed));
          X:= add(L[i]*10^(i-1),i=1..d+1);
          if isprime(X) then
              count:= count+1;
              A[count]:= X;
          fi
    od od od:
    seq(A[n],n=1..N); # Robert Israel, Apr 20 2014
  • Mathematica
    Select[Prime[Range[50000]],Length[Union[{0,1,8},IntegerDigits[ # ]]] == 3&] (* Stefan Steinerberger, Jun 10 2007 *)
    Select[FromDigits/@Tuples[{0,1,8},6],PrimeQ] (* Harvey P. Dale, Jan 12 2016 *)
  • PARI
    a(n=50, L=[0, 1, 8], show=0)={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, Nov 05 2011
    

Extensions

Corrected and extended by Stefan Steinerberger, Jun 10 2007

A199349 Primes having only {3, 4, 9} as digits.

Original entry on oeis.org

3, 43, 349, 433, 439, 443, 449, 499, 3343, 3433, 3449, 3499, 3943, 4339, 4349, 4493, 4933, 4943, 4993, 4999, 9343, 9349, 9433, 9439, 9949, 33343, 33349, 33493, 34439, 34499, 34939, 34949, 39343, 39439, 39443, 39499, 43399, 43499, 43933, 43943, 44449, 44939, 49333, 49339, 49393, 49433, 49499, 49939, 49943, 49993
Offset: 1

Views

Author

M. F. Hasler, Nov 05 2011

Keywords

Comments

A020461 and A020466 are subsequences. - Vincenzo Librandi, Jul 30 2015

Crossrefs

Cf. Primes that contain only the digits (3,4,k): A199340 (k=0), A199341 (k=1), A199342 (k=2), A199345 (k=5), A199346 (k=6), A199347 (k=7), A199348 (k=8).

Programs

  • Magma
    [p: p in PrimesUpTo(2*10^5) | Set(Intseq(p)) subset [3, 4, 9]]; // Vincenzo Librandi, Jul 30 2015
  • Mathematica
    Select[Prime[Range[2 10^4]], Complement[IntegerDigits[#], {3, 4, 9}]=={} &] (* Vincenzo Librandi, Jul 30 2015 *)
    Select[Flatten[Table[FromDigits/@Tuples[{3,4,9},n],{n,5}]],PrimeQ] (* Harvey P. Dale, May 02 2023 *)
  • PARI
    a(n, list=0, L=[3,4,9], reqpal=0)={my(t); for(d=1, 1e9, u=vector(d, i, 10^(d-i))~; forvec(v=vector(d, i, [1+(i==1&!L[1]), #L]), isprime(t=vecextract(L,v)*u) || next; reqpal && !isprime(A004086(t)) && next; list && print1(t", "); n--||return(t)))}
    

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
    

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

Original entry on oeis.org

3, 11, 13, 31, 101, 103, 113, 131, 311, 313, 331, 1013, 1031, 1033, 1103, 1301, 1303, 3001, 3011, 3301, 3313, 3331, 10103, 10111, 10133, 10301, 10303, 10313, 10331, 10333, 11003, 11113, 11131, 11311, 13001, 13003, 13033, 13103, 13313, 13331, 30011, 30013, 30103, 30113, 30133, 30313, 31013, 31033, 31333, 33013
Offset: 1

Views

Author

M. F. Hasler, Jul 25 2015

Keywords

Comments

A subsequence of A107715 and of A111488.
Number of terms < 10^n: 1, 4, 11, 22, 54, 118, 293, 691, 1837, 4871, 13321, 36042, 98325, 272237, 757080, .... - Robert G. Wilson v, Jul 26 2015

Crossrefs

Programs

  • Magma
    [p: p in PrimesUpTo(10^5) | Set(Intseq(p)) subset [0, 1, 3]]; // Vincenzo Librandi, Jul 26 2015
  • Mathematica
    Select[ FromDigits@# & /@ Tuples[{0, 1, 3}, 5], PrimeQ] (* Robert G. Wilson v, Jul 26 2015 *)
    Select[Prime[Range[4 10^3]], Complement[IntegerDigits[#], {0, 1, 3}]=={} &] (* Vincenzo Librandi, Jul 26 2015 *)
  • PARI
    A260044={(n,show=0,L=[0,1,3])->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)))}
    

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

Original entry on oeis.org

3, 11, 13, 31, 41, 43, 113, 131, 311, 313, 331, 431, 433, 443, 1433, 3313, 3331, 3343, 3413, 3433, 4111, 4133, 4441, 11113, 11131, 11311, 11411, 11443, 13313, 13331, 13411, 13441, 14143, 14341, 14411, 14431, 31333, 33113, 33311, 33331, 33343, 33413, 34141, 34313
Offset: 1

Views

Author

M. F. Hasler, Nov 05 2011

Keywords

Comments

A020451, A020452 and A020461 are subsequences. - Vincenzo Librandi, Jul 26 2015

Crossrefs

Cf. similar sequences listed in A199340.

Programs

  • Magma
    [p: p in PrimesUpTo(10^5) | Set(Intseq(p)) subset [3, 4, 1]]; // Vincenzo Librandi, Jul 26 2015
  • Maple
    Dmax:= 5: # to get all terms < 10^Dmax
    Cd:= {1,3,4}:
    C:= Cd:
    for d from 2 to Dmax do
      Cd:= map(t -> (10*t+1,10*t+3,10*t+4),Cd);
      C:= C union Cd;
    od:
    sort(convert(select(isprime,C),list)); # Robert Israel, Jul 26 2015
  • Mathematica
    Select[Prime[Range[4 10^3]], Complement[IntegerDigits[#], {3, 4, 1}]=={} &] (* Vincenzo Librandi, Jul 26 2015 *)
  • PARI
    a(n, list=0, L=[1, 3, 4], reqpal=0)={my(t); for(d=1, 1e9, u=vector(d, i, 10^(d-i))~; forvec(v=vector(d, i, [1+(i==1&!L[1]), #L]), isprime(t=vector(d, i, L[v[i]])*u)||next; reqpal & !isprime(A004086(t)) & next; list & print1(t", "); n--||return(t)))}
    

A199342 Primes having only {2, 3, 4} as digits.

Original entry on oeis.org

2, 3, 23, 43, 223, 233, 433, 443, 2243, 2333, 2423, 3323, 3343, 3433, 4243, 4423, 22343, 22433, 23333, 24223, 24443, 32233, 32323, 32423, 32443, 33223, 33343, 42223, 42323, 42433, 42443, 43223, 222323, 223243, 223423, 224233, 224423, 224443, 232333, 232433, 233323, 233423, 234323, 234343, 242243, 243233, 243343, 243433, 244243, 244333
Offset: 1

Views

Author

M. F. Hasler, Nov 05 2011

Keywords

Comments

A020458 and A020461 are subsequences. - Vincenzo Librandi, Jul 28 2015

Crossrefs

Cf. similar sequences listed in A199340.

Programs

  • Magma
    [p: p in PrimesUpTo(10^6) | Set(Intseq(p)) subset [3, 4, 2]]; // Vincenzo Librandi, Jul 28 2015
  • Mathematica
    Select[Prime[Range[10^5]], Complement[IntegerDigits[#], {3, 4, 2}]=={}&] (* Vincenzo Librandi, Jul 28 2015 *)
    Table[Select[FromDigits/@Tuples[{2,3,4},n],PrimeQ],{n,6}]//Flatten (* Harvey P. Dale, Nov 06 2019 *)
  • PARI
    a(n, list=0, L=[2, 3, 4], reqpal=0)={my(t); for(d=1, 1e9, u=vector(d, i, 10^(d-i))~; forvec(v=vector(d, i, [1+(i==1&!L[1]), #L]), isprime(t=vector(d, i, L[v[i]])*u)||next; reqpal & !isprime(A004086(t)) & next; list & print1(t", "); n--||return(t)))}
    
Showing 1-10 of 30 results. Next