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

A276039 Numbers using only digits 1 and 7.

Original entry on oeis.org

1, 7, 11, 17, 71, 77, 111, 117, 171, 177, 711, 717, 771, 777, 1111, 1117, 1171, 1177, 1711, 1717, 1771, 1777, 7111, 7117, 7171, 7177, 7711, 7717, 7771, 7777, 11111, 11117, 11171, 11177, 11711, 11717, 11771, 11777, 17111, 17117, 17171, 17177, 17711, 17717, 17771, 17777
Offset: 1

Views

Author

Vincenzo Librandi, Aug 19 2016

Keywords

Comments

Numbers k such that the product of digits of k is a power of 7.
There are no prime terms whose number of digits is divisible by 3: for every d that is a multiple of 3, every d-digit number j consisting of no digits other than 1's and 7's will have a digit sum divisible by 3, so j will also be divisible by 3. - Mikk Heidemaa, Mar 27 2021

Examples

			7717 is in the sequence because 7*7*1*7 = 343 = 7^3.
		

Crossrefs

Cf. similar sequences listed in A276037.

Programs

  • Magma
    [n: n in [1..24000] | Set(Intseq(n)) subset {1,7}];
    
  • Mathematica
    Select[Range[20000], IntegerQ[Log[7, Times@@(IntegerDigits[#])]] &] (* or *) Flatten[Table[FromDigits/@Tuples[{1, 7}, n], {n, 6}]]
  • PARI
    is(n) = my(d=digits(n), e=[0, 2, 3, 4, 5, 6, 8, 9]); if(#setintersect(Set(d), Set(e))==0, return(1), return(0)) \\ Felix Fröhlich, Aug 19 2016
    
  • PARI
    a(n) = { my(b = binary(n + 1)); b = b[^1]; b = apply(x -> 6*x + 1, b); fromdigits(b) } \\ David A. Corneth, Mar 27 2021
    
  • Python
    def a(n):
      b = bin(n+1)[3:]
      return int("".join(b.replace("1", "7").replace("0", "1")))
    print([a(n) for n in range(1, 47)]) # Michael S. Branicky, Mar 27 2021
    
  • Python
    def A276039(n): return 6*int(bin(n+1)[3:])+(10**((n+1).bit_length()-1)-1)//9 # Chai Wah Wu, Jun 28 2025

A260889 Primes having only {1, 2, 7} as digits.

Original entry on oeis.org

2, 7, 11, 17, 71, 127, 211, 227, 271, 277, 727, 1117, 1171, 1217, 1277, 1721, 1777, 2111, 2221, 2711, 2777, 7121, 7127, 7177, 7211, 7717, 7727, 11117, 11171, 11177, 11717, 11777, 12211, 12227, 12277, 12721, 17117, 21121, 21211, 21221, 21227, 21277, 21727
Offset: 1

Views

Author

Vincenzo Librandi, Aug 04 2015

Keywords

Comments

A020450, A020455 and A020459 are subsequences.

Crossrefs

Cf. Primes that contain only the digits (k,1,7): A199327 (k=0), this sequence (k=2), A260379 (k=3), A079651 (k=4), A260828 (k=5), A260891 (k=6), A260892 (k=8), A260893 (k=9).

Programs

  • Magma
    [p: p in PrimesUpTo(3*10^4) | Set(Intseq(p)) subset [1, 2, 7]];
  • Mathematica
    Select[Prime[Range[2 10^5]], Complement[IntegerDigits[#], {1, 2, 7}] == {} &]
    Table[Select[FromDigits/@Tuples[{1,2,7},n],PrimeQ],{n,5}]//Flatten (* Harvey P. Dale, Apr 12 2018 *)

A260828 Primes having only {1, 5, 7} as digits.

Original entry on oeis.org

5, 7, 11, 17, 71, 151, 157, 557, 571, 577, 751, 757, 1117, 1151, 1171, 1511, 1571, 1777, 5171, 5557, 5711, 5717, 7151, 7177, 7517, 7577, 7717, 7757, 11117, 11171, 11177, 11551, 11717, 11777, 15511, 15551, 17117, 17551, 51151, 51157, 51511, 51517, 51551, 51577
Offset: 1

Views

Author

Vincenzo Librandi, Aug 02 2015

Keywords

Crossrefs

Subsequence of A030096. A020453, A020455 and A020467 are subsequences.
Cf. similar sequences listed in A260827.
Cf. A000040.

Programs

  • Magma
    [p: p in PrimesUpTo(2*10^5) | Set(Intseq(p)) subset [1,5,7]];
    
  • Mathematica
    Select[Prime[Range[2 10^4]], Complement[IntegerDigits[#], {1, 5, 7}] == {} &]
  • Python
    from sympy import isprime
    from sympy.utilities.iterables import multiset_permutations
    def aupton(terms):
      n, digits, alst = 0, 1, []
      while len(alst) < terms:
        mpstr = "".join(d*digits for d in "157")
        for mp in multiset_permutations(mpstr, digits):
          t = int("".join(mp))
          if isprime(t): alst.append(t)
          if len(alst) == terms: break
        else: digits += 1
      return alst
    print(aupton(44)) # Michael S. Branicky, May 07 2021

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

Original entry on oeis.org

3, 7, 11, 13, 17, 31, 37, 71, 73, 113, 131, 137, 173, 311, 313, 317, 331, 337, 373, 733, 773, 1117, 1171, 1373, 1733, 1777, 3137, 3313, 3331, 3371, 3373, 3733, 7177, 7331, 7333, 7717, 11113, 11117, 11131, 11171, 11173, 11177, 11311, 11317, 11717, 11731, 11777
Offset: 1

Views

Author

Vincenzo Librandi, Jul 24 2015

Keywords

Crossrefs

Subsequence of A030096 and A155055. A020451, A020455, and A020463 are subsequences.
Cf. similar sequences listed in A260378.

Programs

  • Magma
    [p: p in PrimesUpTo(2*10^4) | Set(Intseq(p)) subset [1, 3, 7]];
  • Mathematica
    Select[Prime[Range[2 10^3]], Complement[IntegerDigits[#], {1, 3, 7}]=={} &]

A260891 Primes having only {1, 6, 7} as digits.

Original entry on oeis.org

7, 11, 17, 61, 67, 71, 167, 617, 661, 677, 761, 1117, 1171, 1667, 1777, 6661, 6761, 7177, 7717, 11117, 11161, 11171, 11177, 11617, 11677, 11717, 11777, 16111, 16661, 17117, 17167, 17761, 61667, 61717, 66161, 66617, 67777, 71161, 71167, 71171, 71671
Offset: 1

Views

Author

Vincenzo Librandi, Aug 05 2015

Keywords

Comments

A020454, A020455 and A020469 are subsequences.

Crossrefs

Cf, similar sequences listed in A260889.

Programs

  • Magma
    [p: p in PrimesUpTo(2*10^5) | Set(Intseq(p)) subset [1, 6, 7]];
  • Mathematica
    Select[Prime[Range[2 10^4]], Complement[IntegerDigits[#], {1, 6, 7}] == {} &]

A260892 Primes having only {1, 7, 8} as digits.

Original entry on oeis.org

7, 11, 17, 71, 181, 787, 811, 877, 881, 887, 1117, 1171, 1181, 1187, 1777, 1787, 1811, 1871, 1877, 7177, 7187, 7717, 7817, 7877, 8111, 8117, 8171, 8887, 11117, 11171, 11177, 11717, 11777, 11887, 17117, 17881, 18181, 18787, 71171, 71711, 71777, 71881, 71887
Offset: 1

Views

Author

Vincenzo Librandi, Aug 07 2015

Keywords

Comments

A020455, A020456 and A020470 are subsequences.

Crossrefs

Cf. similar sequences listed in A260889.

Programs

  • Magma
    [p: p in PrimesUpTo(2*10^5) | Set(Intseq(p)) subset [1, 7, 8]];
  • Mathematica
    Select[Prime[Range[2 10^5]], Complement[IntegerDigits[#], {1, 7, 8}] == {} &]

A260893 Primes having only {1, 7, 9} as digits.

Original entry on oeis.org

7, 11, 17, 19, 71, 79, 97, 179, 191, 197, 199, 719, 797, 911, 919, 971, 977, 991, 997, 1117, 1171, 1777, 1979, 1997, 1999, 7177, 7717, 7919, 9199, 9719, 9791, 11117, 11119, 11171, 11177, 11197, 11717, 11719, 11777, 11779, 11971, 17117, 17191, 17791, 17911
Offset: 1

Views

Author

Vincenzo Librandi, Aug 11 2015

Keywords

Comments

A020455, A020457 and A020471 are subsequences.
Subsequence of A030096.

Crossrefs

Cf. similar sequences listed in A260889.

Programs

  • Magma
    [p: p in PrimesUpTo(3*10^4) | Set(Intseq(p)) subset [1, 7, 9]];
  • Mathematica
    Select[Prime[Range[3 10^3]], Complement[IntegerDigits[#], {1, 7, 9}] == {}&]

A036307 Composite numbers whose prime factors contain no digits other than 1 and 7.

Original entry on oeis.org

49, 77, 119, 121, 187, 289, 343, 497, 539, 781, 833, 847, 1207, 1309, 1331, 2023, 2057, 2401, 3179, 3479, 3773, 4913, 5041, 5467, 5831, 5929, 7819, 8197, 8449, 8591, 9163, 9317, 12287, 12439, 12881, 13277, 14161, 14399, 14641, 16807, 18989, 19547
Offset: 1

Views

Author

Patrick De Geest, Dec 15 1998

Keywords

Comments

All terms are a product of at least two terms of A020455. - David A. Corneth, Oct 09 2020

Crossrefs

Formula

Sum_{n>=1} 1/a(n) = Product_{p in A020455} (p/(p - 1)) - Sum_{p in A020455} 1/p - 1 = 0.0775663737... . - Amiram Eldar, May 18 2022

A036934 Smallest n-digit prime containing only digits 1 and 7, or 0 if no such prime exists.

Original entry on oeis.org

7, 11, 0, 1117, 11117, 0, 1111711, 11111117, 0, 1111117171, 11111111771, 0, 1111111111177, 11111111171177, 0, 1111111111171177, 11111111111111171, 0, 1111111111111111111, 11111111111111117111, 0, 1111111111111111111711
Offset: 1

Views

Author

Patrick De Geest, Jan 04 1999

Keywords

Crossrefs

Programs

  • Mathematica
    Flatten[Table[Select[FromDigits/@Tuples[{1, 7}, n], PrimeQ, 1], {n, 25}]/.{}->{0}] (* Jinyuan Wang, Mar 09 2020 *)

Extensions

a(16) corrected by Jinyuan Wang, Mar 09 2020

A358020 Least prime number > prime(n) (n >= 5) whose set of decimal digits coincides with the set of decimal digits of prime(n), or -1 if no such prime exists.

Original entry on oeis.org

1111111111111111111, 31, 71, 191, 223, 229, 113, 73, 4111, 433, 4447, 353, 599, 661, 677, 1117, 337, 97, 383, 8999, 797, 10111, 1013, 701, 1009, 131, 271, 311, 173, 193, 419, 1151, 571, 613, 617, 317, 197, 811, 199, 1193, 719, 911, 2111, 233, 277, 929, 2333, 293, 421, 521, 2557
Offset: 5

Views

Author

Jean-Marc Rebert, Oct 24 2022

Keywords

Examples

			prime(6) = 13 and the prime number 31 have the same set of digits {1,3}, and 31 is the smallest such number, hence a(6) = 31.
prime(13) = 41 and the prime number 4111 have the same set of digits {1,4}, and 4111 is the smallest such number, hence a(13) = 4111.
prime(20) = 71 and the prime number 1117 have the same set of digits {1,7}, and 1117 is the smallest such number, hence a(20) = 1117.
		

Crossrefs

Programs

  • Maple
    N:= 60: # for a(5)..a(N)
    A:= Array(5..N):
    R:= 1111111111111111111:
    A[5]:= R: count:= 1:
    for k from 6 while count < N-4 do
      p:= ithprime(k);
      S:= convert(convert(p,base,10),set);
      if assigned(V[S]) and V[S]<=N then A[V[S]]:= p; count:=count+1;  fi;
      V[S]:= k;
    od:
    convert(A,list); # Robert Israel, Oct 25 2022
  • PARI
    a(n)=my(m=Set(digits(prime(n)))); if(n<5, return()); if(n==5,return(1111111111111111111));forprime(p=prime(n+1), , if(Set(digits(p))==m, return(p)))
    
  • Python
    from sympy import isprime, prime
    from itertools import count, product
    def a(n):
        pn = prime(n)
        s = str(pn)
        for d in count(len(s)):
            for p in product(set(s), repeat=d):
                if p[0] == "0": continue
                t = int("".join(p))
                if t > pn and isprime(t):
                    return t
    print([a(n) for n in range(5, 56)]) # Michael S. Branicky, Oct 25 2022
Showing 1-10 of 11 results. Next