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.

A107666 Primes having only {4, 6, 9} as digits.

Original entry on oeis.org

449, 499, 4649, 4969, 4999, 6449, 6469, 6949, 9649, 9949, 44449, 44699, 46499, 46649, 49499, 49669, 49999, 64499, 64969, 66449, 66499, 66949, 69499, 94649, 94949, 94999, 96469, 99469, 444449, 444469, 444649, 446969, 449699, 464699, 464999, 466649, 469649, 469969
Offset: 1

Views

Author

Rick L. Shepherd, May 19 2005

Keywords

Comments

Intersection of A000040 and A107665. - K. D. Bajpai, Sep 08 2014

Examples

			From _K. D. Bajpai_, Sep 08 2014: (Start)
4649 is a term because it is a prime having only semiprime digits 4, 6 and 9.
6469 is a term because it is a prime having only semiprime digits 4, 6 and 9.
449 is the smallest prime comprising only semiprime digits 4, 6 or 9.
(End)
		

Crossrefs

Cf. A107665 (numbers with semiprime digits), A001358 (semiprimes), A051416 (primes whose digits are all composite), A020466 (primes with digits 4 and 9 only), A093402 (primes of form 44...9), A093945 (primes of form 499...).

Programs

  • Maple
    N:= 4:  Dgts:= {4, 6, 9}:  A:= NULL:
    for d from 1 to N do
    K:= combinat[cartprod]([Dgts minus {0}, Dgts $(d-1)]);
    while not K[finished] do L:= K[nextvalue]();  x:= add(L[i]*10^(d-i), i=1..d);
    if isprime(x) then A:= A, x fi od od: A;  # K. D. Bajpai, Sep 08 2014
  • Mathematica
    Select[Prime[Range[50000]], Intersection[IntegerDigits[#], {0, 1, 2, 3, 5, 7, 8}] == {} &] (* K. D. Bajpai, Sep 08 2014 *)

Extensions

a(35)-a(38) from K. D. Bajpai, Sep 08 2014

A061372 Primes having only 0,4,6,8,9 as digits.

Original entry on oeis.org

89, 409, 449, 499, 809, 4049, 4099, 4409, 4649, 4889, 4909, 4969, 4999, 6089, 6449, 6469, 6689, 6869, 6899, 6949, 8009, 8069, 8089, 8609, 8669, 8689, 8699, 8849, 8969, 8999, 9049, 9649, 9689, 9949, 40009, 40099, 40499, 40609, 40699, 40849, 40949
Offset: 1

Views

Author

Amarnath Murthy, May 02 2001

Keywords

Comments

Primes having digits that are all 0 or composite.

Examples

			a(5) = 4049 is a prime and 4,0,9 are 0 or composite digits.
		

Crossrefs

Programs

  • Mathematica
    Select[FromDigits/@Tuples[{0,4,6,8,9},5],PrimeQ] (* Harvey P. Dale, May 04 2011 *)

Extensions

More terms from Erich Friedman, May 08 2001
Definition corrected Dec 05 2006

A279366 Primes whose proper substrings of consecutive digits are all composite.

Original entry on oeis.org

89, 449, 499, 4649, 4969, 6469, 6869, 6949, 8669, 8699, 8849, 9649, 9949, 44699, 46649, 48649, 48869, 49669, 64849, 84869, 86969, 88469, 94849, 94949, 98869, 99469, 444469, 444869, 446969, 466649, 468869, 469849, 469969, 494699, 496669, 496849, 498469, 644669
Offset: 1

Views

Author

Rodrigo de O. Leite, Dec 10 2016

Keywords

Comments

All digits are composite. Each term ends with the digit '9'. Since each term is prime, it never serves as the suffix of any subsequent term; e.g., no term beyond 89 ends with the digits '89', so the only remaining allowed two-digit endings are '49', '69', and '99'; no terms beyond 449 and 499 end with '449' or '499' (and '899' is ruled out because of 89), so the only remaining allowed three-digit endings are '469', '649', '669', '699', '849', '869', '949', '969', and '999' (and each of these appears as the ending of at least one four-digit term, except '999', which doesn't appear as the ending of any term until a(75) = 4696999). - Jon E. Schoenfield, Dec 10 2016
Number of terms < 10^k, k=1,2,3,...: 0, 1, 2, 10, 13, 38, 66, 197, 410, 1053, 2542, 7159, 18182, 49388, ..., . Robert G. Wilson v, Jan 15 2017

Examples

			44699 is in the sequence because 4, 6, 9, 44, 46, 69, 99, 446, 469, 669, 4469 and 4699 are composite numbers. However, 846499 is not included because 4649 is prime.
		

Crossrefs

Subsequence of A051416.

Programs

  • Mathematica
    Select[Prime@ Range[5, 10^5], Function[n, Times @@ Boole@ Map[CompositeQ, Flatten@ Map[FromDigits /@ Partition[n, #, 1] &, Range[Length@ n - 1]]] == 1]@ IntegerDigits@ # &] (* Michael De Vlieger, Dec 10 2016 *)
    Select[Flatten[Table[FromDigits/@Tuples[{4,6,8,9},d],{d,6}]],PrimeQ[#]&&AllTrue[ FromDigits /@ Union[Flatten[Table[Partition[IntegerDigits[#],n,1],{n,IntegerLength[#]-1}],1]], CompositeQ]&] (* Harvey P. Dale, Jul 15 2023 *)
  • Python
    from sympy import isprime
    from itertools import count, islice, product
    def ok(n):
        s = str(n)
        if set(s) & {"1", "2", "3", "5", "7"} or not isprime(n): return False
        ss2 = set(s[i:i+l] for i in range(len(s)-1) for l in range(2, len(s)))
        return not any(isprime(int(ss)) for ss in ss2)
    def agen():
        for d in count(2):
            for p in product("4689", repeat=d-1):
                t = int("".join(p)+"9")
                if ok(t): yield t
    print(list(islice(agen(), 38))) # Michael S. Branicky, Oct 07 2022

A157527 Primes using only the composite digits (4, 6, 8, 9) and all of them.

Original entry on oeis.org

46489, 46889, 48649, 48869, 64489, 64849, 68449, 68489, 84649, 84869, 88469, 444869, 448969, 449689, 468499, 468869, 468889, 468899, 469849, 486449, 486869, 486949, 488689, 489689, 489869, 496849, 496889, 498469, 498689, 644489, 644869
Offset: 1

Views

Author

Lekraj Beedassy, Mar 02 2009, Mar 03 2009

Keywords

Comments

Subsequence of A051416.
There are no 4-digit terms so each term must have at least one repeating digit. - Harvey P. Dale, Oct 05 2023

Crossrefs

Programs

  • Maple
    a := proc (n) if convert(convert(ithprime(n), base, 10), set) = {4, 6, 8, 9} then ithprime(n) else end if end proc: seq(a(n), n = 1 .. 53000); # Emeric Deutsch, Mar 03 2009
    isA157527 := proc(n) local dgs ; if not isprime(n) then false; else dgs := convert(convert(n,base,10),set) ; if dgs intersect {4,6,8,9} <> {4,6,8,9} then false; elif dgs intersect {0,1,2,3,5,7} <> {} then false; else true; fi; fi; end: for n from 1 to 100000 do p := ithprime(n) ; if isA157527(p) then printf("%d,",p) ; fi; od: # R. J. Mathar, Mar 03 2009
  • Mathematica
    With[{c={4,6,8,9}},Select[Flatten[Table[10 FromDigits/@Tuples[c,n]+9,{n,5}]],PrimeQ[#] && Intersection[c,IntegerDigits[#]]==c&]] (* Harvey P. Dale, Oct 05 2023 *)

Extensions

Corrected and extended by numerous correspondents, Mar 04 2009

A342049 Primes formed by the concatenation of exactly two consecutive composite numbers.

Original entry on oeis.org

89, 5051, 5657, 6263, 6869, 8081, 9091, 9293, 120121, 186187, 188189, 200201, 216217, 242243, 246247, 252253, 278279, 300301, 308309, 318319, 338339, 342343, 350351, 362363, 368369, 390391, 402403, 410411, 416417, 426427, 428429, 440441, 446447, 450451, 452453, 470471, 476477, 482483
Offset: 1

Views

Author

Bernard Schott, Feb 26 2021

Keywords

Comments

When a prime is obtained by the concatenation of exactly two consecutive composite numbers, the first one always ends with 0, 2, 6, 8 while the second one ends respectively with 1, 3, 7, 9.
a(1) = 89 is also the smallest prime whose digits are composite (A051416).
a(n) has an even number of digits. If it would have an odd number of digits then it is like 99..99100..00 but that is composite. - David A. Corneth, Feb 27 2021

Examples

			If (2,q) is the smallest term formed by the concatenation of 2 consecutive composite numbers with each q digits: (2,1) = a(1) = 89, (2,2) = a(2) = 5051, (2,3) = a(9) = 120121, (2,4) = 10021003, (2,5) = 1001010011, (2,6) = 100010100011.
		

Crossrefs

Subsequence of A030458 and A121608.

Programs

  • PARI
    isc(c) = (c>1) && ! isprime(c);
    isok(p) = {if (isprime(p), my(d=digits(p)); for (i=1, #d-1, my(b = fromdigits(vector(i, k, d[k]))); if (d[i+1], my(c = fromdigits(vector(#d-i, k, d[k+i]))); if (isc(b) && isc(c) && ((primepi(c) - primepi(b)) == c-b-1), return (1)); ); ); ); } \\ Michel Marcus, Feb 27 2021
    
  • PARI
    first(n) = { pc = 4; my(res = vector(n)); t = 0; forcomposite(c = 6, oo, nc = pc * 10^#digits(c) + c; if(isprime(nc), t++; res[t] = nc; if(t >= n, return(res) ) ); pc = c; ) } \\ David A. Corneth, Feb 27 2021
    
  • PARI
    is(n) = { my(d = digits(n)); if(#d % 2 == 1, return(0) ); fc = fromdigits(vector(#d \ 2, i, d[i])); lc = fromdigits(vector(#d \ 2, i, d[i+#d\2])); lc - fc == 1 && !isprime(fc) && !isprime(lc) && nextprime(fc)==nextprime(lc) && isprime(n) } \\ David A. Corneth, Feb 27 2021
    
  • Python
    from sympy import isprime
    def agento(lim):
      digs, pow10 = 1, 10
      while True:
        for c2 in range(max(pow10//10+1, 3), pow10, 2):
          if not isprime(c2) and not isprime(c2-1):
            c1c2 = (c2-1)*pow10+c2
            if c1c2 > lim: return
            if isprime(c1c2): yield c1c2
        digs, pow10 = digs+1, pow10*10
    print([an for an in agento(482483)]) # Michael S. Branicky, Feb 27 2021

A386193 Primes having only {4, 6, 7, 8} as digits.

Original entry on oeis.org

7, 47, 67, 467, 487, 647, 677, 787, 877, 887, 4447, 4787, 4877, 7477, 7487, 7687, 7867, 7877, 8447, 8467, 8647, 8677, 8747, 8867, 8887, 44647, 44687, 44777, 44867, 44887, 46447, 46477, 46687, 46747, 46867, 46877, 47777, 48487, 48647, 48677, 48767, 48787, 48847
Offset: 1

Views

Author

Jason Bard, Jul 18 2025

Keywords

Crossrefs

Supersequence of A385794, A385795, A385799.

Programs

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

A386194 Primes having only {4, 6, 7, 9} as digits.

Original entry on oeis.org

7, 47, 67, 79, 97, 449, 467, 479, 499, 647, 677, 769, 797, 947, 967, 977, 997, 4447, 4649, 4679, 4799, 4967, 4969, 4999, 6449, 6469, 6679, 6779, 6947, 6949, 6967, 6977, 6997, 7477, 7499, 7649, 7669, 7699, 7949, 9467, 9479, 9497, 9649, 9677, 9679, 9697, 9749, 9767
Offset: 1

Views

Author

Jason Bard, Jul 18 2025

Keywords

Crossrefs

Supersequence of A107666, A261183, A261184, A385794.

Programs

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

A386195 Primes having only {4, 7, 8, 9} as digits.

Original entry on oeis.org

7, 47, 79, 89, 97, 449, 479, 487, 499, 787, 797, 877, 887, 947, 977, 997, 4447, 4787, 4789, 4799, 4877, 4889, 4987, 4999, 7477, 7487, 7489, 7499, 7789, 7877, 7879, 7949, 8447, 8747, 8779, 8849, 8887, 8999, 9479, 9497, 9749, 9787, 9887, 9949, 44449, 44497, 44777
Offset: 1

Views

Author

Jason Bard, Jul 18 2025

Keywords

Crossrefs

Supersequence of A106110, A261183, A385795, A385796.

Programs

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