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 41 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) */
    

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

A036325 Composite numbers whose prime factors have no digits other than 8 and 9.

Original entry on oeis.org

7921, 704969, 800911, 8001011, 8009021, 8802011, 8810911, 8899021, 62742241, 71281079, 79120021, 80001121, 80982001, 88109911, 88910021, 712089979, 712802869, 783378979, 784171079, 791120021, 791200121, 792012869, 800020021, 800109911, 800901121, 800991011, 809001101, 809811011, 880111121
Offset: 1

Views

Author

Patrick De Geest, Dec 15 1998

Keywords

Comments

All terms are a product of at least two terms of A020472. - David A. Corneth, Apr 30 2018

Examples

			7921 is in the sequence because it's composite and its only prime factor is 89, only having digits 8 or 9. - _David A. Corneth_, Apr 30 2018
		

Crossrefs

Programs

  • Maple
    N:= 9: # to get all terms of <= N digits
    R:= 10^N: G:= {9}: S:= {1}:
    for n from 1 to N-1 do
      G:= map(t -> (t+8*10^n,t+9*10^n), G);
      newprimes:= select(isprime, G);
      for p in newprimes do
        S:= map(s -> seq(s*p^i,i=0..floor(log[p](R/s))), S)
      od
    od:
    sort(convert(remove(isprime, S minus {1}),list)); # Robert Israel, Apr 30 2018

Formula

Sum_{n>=1} 1/a(n) = Product_{p in A020472} (p/(p - 1)) - Sum_{p in A020472} 1/p - 1 = 0.0001296249159... . - Amiram Eldar, May 22 2022

Extensions

More terms from Robert Israel, Apr 29 2018

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)))}
    

A020471 Primes that contain digits 7 and 9 only.

Original entry on oeis.org

7, 79, 97, 797, 977, 997, 77797, 77977, 77999, 79777, 79979, 79997, 79999, 97777, 777977, 777979, 779797, 797977, 799979, 799999, 999979, 7777997, 7779979, 7779997, 7797799, 7797997, 7799797, 7799999, 7977779, 7977797, 7977799, 7977997
Offset: 1

Views

Author

Keywords

Crossrefs

Subsequence of A030096.
Cf. A020449 (digits 0 & 1), ..., A020472 (digits 8 & 9).

Programs

  • Magma
    [p: p in PrimesUpTo(7977997) | Set(Intseq(p)) subset [7,9]]; // Vincenzo Librandi, Jul 28 2012
  • Mathematica
    Flatten[Table[Select[FromDigits/@Tuples[{7,9},n],PrimeQ],{n,7}]] (* Vincenzo Librandi, Jul 28 2012 *)

Extensions

Edited by M. F. Hasler, Jul 26 2015

A020450 Primes that contain digits 1 and 2 only.

Original entry on oeis.org

2, 11, 211, 2111, 2221, 12211, 21121, 21211, 21221, 22111, 111121, 111211, 112111, 112121, 1111211, 1121221, 1212121, 1212221, 1221221, 2121121, 2211211, 2221111, 11221211, 12111221, 12121121, 12121211, 12122111, 12122221, 12212111, 12222121
Offset: 1

Views

Author

Keywords

Crossrefs

Cf. A020449 (digits 0 & 1), ..., A020472 (digits 8 & 9). [From M. F. Hasler, Mar 18 2010]
Subsequence of A007931.

Programs

  • Magma
    [p: p in PrimesUpTo(12222121) | Set(Intseq(p)) subset [1, 2]]; // Vincenzo Librandi, Jul 28 2012
    
  • Mathematica
    Flatten[Table[Select[FromDigits/@Tuples[{1,2},n],PrimeQ],{n,8}]] (* Vincenzo Librandi, Jul 28 2012 *)
  • PARI
    for(nd=1,9, forvec(v=vector(nd,i,[49,50-(i==nd && i>1)]), isprime(t=eval(Strchr(Vecsmall(v)))) && print1(t","))) \\ M. F. Hasler, Mar 18 2010
    
  • Python
    from sympy import primerange
    def checkd(a, c):
        b =  set(int(i) for i in set(str(a)))
        return b.issubset(c)
    for n in primerange(2, 2000000):
        if checkd(n, [1, 2]):
            print(n)
    # Abhiram R Devesh, May 08 2015

A020469 Primes that contain digits 6 and 7 only.

Original entry on oeis.org

7, 67, 677, 67777, 76667, 76777, 666667, 677767, 767677, 777677, 6676667, 6676777, 6677677, 6677767, 6677777, 6766667, 6766777, 6776677, 7666667, 7667677, 7667767, 7766767, 7766777, 7777667, 66666667, 66677777, 66776777, 67667777, 67766767, 67776677, 67776767
Offset: 1

Views

Author

Keywords

Crossrefs

Programs

  • Mathematica
    Flatten[Table[Select[FromDigits/@Tuples[{6,7},n],PrimeQ],{n,8}]] (* Vincenzo Librandi, Jul 27 2012 *)
  • Python
    from sympy import isprime
    from itertools import count, islice, product
    def agen(): # generator of terms
        yield 7
        for d in count(2):
            for first in product("67", repeat=d-1):
                t = int("".join(first) + "7")
                if isprime(t): yield t
    print(list(islice(agen(), 31))) # Michael S. Branicky, Nov 15 2022
Showing 1-10 of 41 results. Next