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.

A019546 Primes whose digits are primes; primes having only {2, 3, 5, 7} as digits.

Original entry on oeis.org

2, 3, 5, 7, 23, 37, 53, 73, 223, 227, 233, 257, 277, 337, 353, 373, 523, 557, 577, 727, 733, 757, 773, 2237, 2273, 2333, 2357, 2377, 2557, 2753, 2777, 3253, 3257, 3323, 3373, 3527, 3533, 3557, 3727, 3733, 5227, 5233, 5237, 5273, 5323, 5333, 5527, 5557
Offset: 1

Views

Author

R. Muller

Keywords

Comments

Intersection of A046034 and A000040; A055642(a(n)) = A193238(a(n)). - Reinhard Zumkeller, Jul 19 2011
Ribenboim mentioned in 2000 the following number as largest known term: 72323252323272325252 * (10^3120 - 1) / (10^20 - 1) + 1. It has 3120 digits, and was discovered by Harvey Dubner in 1992. Larger terms are 22557252272*R(15600)/R(10) and 2255737522*R(15600) where R(n) denotes the n-th repunit (see A002275): Both have 15600 digits and were found in 2002, also by Dubner (see Weisstein link). David Broadhurst reports in 2003 an even longer number with 82000 digits: (10^40950+1) * (10^20055+1) * (10^10374 + 1) * (10^4955 + 1) * (10^2507 + 1) * (10^1261 + 1) * (3*R(1898) + 555531001*10^940 - R(958)) + 1, see link. - Reinhard Zumkeller, Jan 13 2012
The smallest and largest primes that use exactly once the four prime decimal digits are respectively a(27)= 2357 and a(54) = 7523. - Bernard Schott, Apr 27 2023

References

  • Paulo Ribenboim, Prime Number Records (Chap 3), in 'My Numbers, My Friends', Springer-Verlag 2000 NY, page 76.

Crossrefs

Cf. A020463 (subsequence).
A093162, A093164, A093165, A093168, A093169, A093672, A093674, A093675, A093938 and A093941 are subsequences. - XU Pingya, Apr 20 2017

Programs

  • Haskell
    a019546 n = a019546_list !! (n-1)
    a019546_list = filter (all (`elem` "2357") . show )
                          ([2,3,5] ++ (drop 2 a003631_list))
    -- Or, much more efficient:
    a019546_list = filter ((== 1) . a010051) $
                          [2,3,5,7] ++ h ["3","7"] where
       h xs = (map read xs') ++ h xs' where
         xs' = concat $ map (f xs) "2357"
         f xs d = map (d :) xs
    -- Reinhard Zumkeller, Jul 19 2011
    
  • Magma
    [p: p in PrimesUpTo(5600) | Set(Intseq(p)) subset [2,3,5,7]]; // Bruno Berselli, Jan 13 2012
    
  • Mathematica
    Select[Prime[Range[700]], Complement[IntegerDigits[#], {2, 3, 5, 7}] == {} &] (* Alonso del Arte, Aug 27 2012 *)
    Select[Prime[Range[700]], AllTrue[IntegerDigits[#], PrimeQ] &] (* Ivan N. Ianakiev, Jun 23 2018 *)
    Select[Flatten[Table[FromDigits/@Tuples[{2,3,5,7},n],{n,4}]],PrimeQ] (* Harvey P. Dale, Apr 05 2025 *)
  • PARI
    is_A019546(n)=isprime(n) & !setminus(Set(Vec(Str(n))),Vec("2357")) \\ M. F. Hasler, Jan 13 2012
    
  • PARI
    print1(2); for(d=1,4, forstep(i=1,4^d-1,[1,1,2], p=sum(j=0,d-1,10^j*[2,3,5,7][(i>>(2*j))%4+1]); if(isprime(p), print1(", "p)))) \\ Charles R Greathouse IV, Apr 29 2015
    
  • Python
    from itertools import product
    from sympy import isprime
    A019546_list = [2,3,5,7]+[p for p in (int(''.join(d)+e) for l in range(1,5) for d in product('2357',repeat=l) for e in '37') if isprime(p)] # Chai Wah Wu, Jun 04 2021

Extensions

More terms from Cino Hilliard, Aug 06 2006
Thanks to Charles R Greathouse IV and T. D. Noe for massive editing support.

A080608 Deletable primes: primes such that removing some digit leaves either the empty string or another deletable prime (possibly preceded by some zeros).

Original entry on oeis.org

2, 3, 5, 7, 13, 17, 23, 29, 31, 37, 43, 47, 53, 59, 67, 71, 73, 79, 83, 97, 103, 107, 113, 127, 131, 137, 139, 157, 163, 167, 173, 179, 193, 197, 223, 229, 233, 239, 263, 269, 271, 283, 293, 307, 311, 313, 317, 331, 337, 347, 353, 359, 367, 373, 379, 383, 397, 431, 433, 439
Offset: 1

Views

Author

David W. Wilson, Feb 25 2003

Keywords

Comments

Subsequence of A179336. - Reinhard Zumkeller, Jul 11 2010
Leading zeros are allowed in the number that appears after the digit is deleted. For example the prime 100003 is deletable because of the sequence 00003, 0003, 003, 03, 3 consists of primes. Because of this, it appears that deletable primes are relatively common in the region just above a power of ten. For example 10^1000 + 2713 is a deletable prime. - Jeppe Stig Nielsen, Aug 01 2018
For a version that does not allow leading zeros, see A305352. - Jeppe Stig Nielsen, Aug 01 2018

Examples

			410256793 is a deletable prime since each member of the sequence 410256793, 41256793, 4125673, 415673, 45673, 4567, 467, 67, 7 is prime (Weisstein, Caldwell).
		

Crossrefs

Programs

  • Maple
    read("transforms"):
    isA080608 := proc(n)
        option remember;
        local dgs,i ;
        if isprime(n) then
            if n < 10 then
                true;
            else
                dgs := convert(n,base,10) ;
                for i from 1 to nops(dgs) do
                    subsop(i=NULL,dgs) ;
                    digcatL(ListTools[Reverse](%)) ;
                    if procname(%)  then
                        return true;
                    end if;
                end do:
                false ;
            end if;
        else
            false;
        end if;
    end proc:
    n := 1;
    for i from 1 to 500 do
        p := ithprime(i) ;
        if isA080608(p) then
            printf("%d %d\n",n,p) ;
            n := n+1 ;
        fi ;
    end do: # R. J. Mathar, Oct 11 2014
  • Mathematica
    Rest@ Union@ Nest[Function[{a, p}, Append[a, With[{w = IntegerDigits[p]}, If[# == True, p, 0] &@ AnyTrue[Array[FromDigits@ Delete[w, #] &, Length@ w], ! FreeQ[a, #] &]]]] @@ {#, Prime[Length@ # + 1]} &, Prime@ Range@ PrimePi@ 10, 81] (* Michael De Vlieger, Aug 02 2018 *)
  • PARI
    is(n) = !ispseudoprime(n)&&return(0);my(d=digits(n));#d==1&&return(1);for(i=1,#d,is(fromdigits(vecextract(d,Str("^"i))))&&return(1));0 \\ Jeppe Stig Nielsen, Aug 01 2018
    
  • Perl
    use ntheory ":all"; sub is { my $n=shift; return 0 unless is_prime($n); my @d=todigits($n); return 1 if @d==1; is(fromdigits([vecextract(\@d,~(1<<$))])) && return 1 for 0..$#d; 0; } # _Dana Jacobsen, Nov 16 2018
    
  • Python
    from sympy import isprime
    def ok(n):
        if not isprime(n): return False
        if n < 10: return True
        s = str(n)
        si = (s[:i]+s[i+1:] for i in range(len(s)))
        return any(ok(int(t)) for t in si)
    print([k for k in range(440) if ok(k)]) # Michael S. Branicky, Jan 28 2023

A034844 Primes with only nonprime decimal digits.

Original entry on oeis.org

11, 19, 41, 61, 89, 101, 109, 149, 181, 191, 199, 401, 409, 419, 449, 461, 491, 499, 601, 619, 641, 661, 691, 809, 811, 881, 911, 919, 941, 991, 1009, 1019, 1049, 1061, 1069, 1091, 1109, 1181, 1409, 1481, 1489, 1499, 1601, 1609, 1619, 1669, 1699, 1801, 1811
Offset: 1

Views

Author

Keywords

Comments

A109066(n) = 0 iff prime(n) is in this sequence. [Reinhard Zumkeller, Jul 11 2010, corrected by M. F. Hasler, Aug 27 2012]
Or, primes p such that A193238(p) = 0. - M. F. Hasler, Aug 27 2012
Intersection of A084984 and A000040; complement of A179336 (within the primes A000040). [Reinhard Zumkeller, Jul 19 2011, edited by M. F. Hasler, Aug 27 2012]
The smallest prime that contains all the six nonprime decimal digits is a(694) = 104869 (see Prime Curios! link). - Bernard Schott, Mar 21 2023

Examples

			E.g. 149 is a prime made of nonprime digits(1,4,9).
991 is a prime without any prime digits.
		

Crossrefs

Programs

  • Haskell
    a034844 n = a034844_list !! (n-1)
    a034844_list = filter (not . any  (`elem` "2357") . show ) a000040_list
    -- Reinhard Zumkeller, Jul 19 2011
    
  • Magma
    [p: p in PrimesUpTo(2000) | forall{d: d in [2,3,5,7] | d notin Set(Intseq(p))}];  // Bruno Berselli, Jul 27 2011
    
  • Mathematica
    Select[Prime[Range[279]], Intersection[IntegerDigits[#], {2, 3, 5, 7}] == {} &] (* Jayanta Basu, Apr 18 2013 *)
    Union[Select[Flatten[Table[FromDigits/@Tuples[{1,4,6,8,9,0},n],{n,2,4}]],PrimeQ]] (* Harvey P. Dale, Dec 08 2014 *)
  • PARI
    is_A034844(n)=isprime(n)&!apply(x->isprime(x),eval(Vec(Str(n)))) \\ M. F. Hasler, Aug 27 2012
    
  • PARI
    is_A034844(n)=isprime(n)&!setintersect(Set(Vec(Str(n))),Vec("2357")) \\ M. F. Hasler, Aug 27 2012
    
  • Python
    from sympy import isprime
    from itertools import product
    def auptod(maxdigits):
        alst = []
        for d in range(1, maxdigits+1):
            for p in product("014689", repeat=d-1):
                if d > 1 and p[0] == "0": continue
                for end in "19":
                    s = "".join(p) + end
                    t = int(s)
                    if isprime(t): alst.append(t)
        return alst
    print(auptod(4)) # Michael S. Branicky, Nov 19 2021

Formula

a(n) >> n^1.285. [Charles R Greathouse IV, Feb 20 2012]

Extensions

Edited by N. J. A. Sloane, Feb 22 2009 at the suggestion of R. J. Mathar

A109066 Number of prime digits in n-th prime.

Original entry on oeis.org

1, 1, 1, 1, 0, 1, 1, 0, 2, 1, 1, 2, 0, 1, 1, 2, 1, 0, 1, 1, 2, 1, 1, 0, 1, 0, 1, 1, 0, 1, 2, 1, 2, 1, 0, 1, 2, 1, 1, 2, 1, 0, 0, 1, 1, 0, 1, 3, 3, 2, 3, 2, 1, 2, 3, 2, 1, 2, 3, 1, 2, 2, 2, 1, 2, 2, 2, 3, 2, 1, 3, 2, 2, 3, 2, 2, 1, 2, 0, 0, 0, 1, 1, 2, 1, 1, 0, 2, 0, 1, 1, 1, 1, 0, 0, 2, 1, 2, 3, 1, 2, 3, 2, 1, 2
Offset: 1

Views

Author

Zak Seidov, Jun 17 2005

Keywords

Comments

The prime A000040(n) is in A034844 iff a(n) = 0; it is in A179336 iff a(n) > 0. [Reinhard Zumkeller, Jul 11 2010, corrected by M. F. Hasler, Aug 27 2012]

Crossrefs

Cf. A019546 (primes whose digits are primes), A092629 (number of prime digits is nonprime), A104250 (sum of prime digits of n-th prime).

Programs

  • Mathematica
    a[n_]:=Count[PrimeQ/@IntegerDigits[Prime[n]], True]
  • PARI
    a(n) = vecsum(apply(x->isprime(x), digits(prime(n)))); \\ Michel Marcus, Mar 15 2019

Formula

a(n) = A193238(A000040(n)). [Reinhard Zumkeller, Jul 19 2011]

A118950 Numbers containing at least one prime digit.

Original entry on oeis.org

2, 3, 5, 7, 12, 13, 15, 17, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 42, 43, 45, 47, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 62, 63, 65, 67, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 82, 83, 85, 87, 92, 93, 95, 97, 102, 103, 105, 107, 112
Offset: 1

Views

Author

Rick L. Shepherd, May 06 2006

Keywords

Comments

A193238(a(n)) > 0; complement of A084984; A092620, A092624 and A092625 are subsequences. - Reinhard Zumkeller, Jul 19 2011

Crossrefs

Programs

  • Haskell
    a118950 n = a118950_list !! (n-1)
    a118950_list = filter (any (`elem` "2357") . show ) [0..]
    -- Reinhard Zumkeller, Jul 19 2011
    
  • Mathematica
    Select[Range[150],AnyTrue[IntegerDigits[#],PrimeQ]&] (* Requires Mathematica version 10 or later *) (* Harvey P. Dale, Jul 19 2018 *)
  • PARI
    is(n)=!!#select(isprime, digits(n)) \\ Charles R Greathouse IV, Sep 15 2015

Formula

a(n) = n + O(n^k) with k = log 6/log 10 = 0.77815.... - Charles R Greathouse IV, Sep 15 2015

A179335 a(n) is the smallest prime which appears as a substring of the decimal representation of prime(n).

Original entry on oeis.org

2, 3, 5, 7, 11, 3, 7, 19, 2, 2, 3, 3, 41, 3, 7, 3, 5, 61, 7, 7, 3, 7, 3, 89, 7, 101, 3, 7, 109, 3, 2, 3, 3, 3, 149, 5, 5, 3, 7, 3, 7, 181, 19, 3, 7, 19, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 401, 409, 19, 2, 3, 3, 3, 3, 449, 5, 61, 3, 7, 7, 7
Offset: 1

Views

Author

Reinhard Zumkeller, Jul 11 2010

Keywords

Comments

a(n) < 10 iff prime(n) is in A179336;
a(n) = prime(n) iff prime(n) is in A033274. [Corrected by M. F. Hasler, Aug 27 2012]

Crossrefs

Programs

  • PARI
    A179335(n)={my(p=prime(n),m=0,M); for(d=1,n, M=10^d; n=p; until(n<=M || !n\=10, isprime(n%M) & (!m || m>n%M) & m=n%M); m & return(m))} \\ M. F. Hasler, Aug 27 2012
    
  • Python
    from sympy import isprime, prime
    def a(n):
        s = str(prime(n))
        ss = set(int(s[i:i+1+l]) for i in range(len(s)) for l in range(len(s)))
        return min(t for t in ss if isprime(t))
    print([a(n) for n in range(1, 94)]) # Michael S. Branicky, Jun 29 2022

A108614 Semiprimes with non-semiprimes digits (no digits 4,6,9 in semiprimes).

Original entry on oeis.org

10, 15, 21, 22, 25, 33, 35, 38, 51, 55, 57, 58, 77, 82, 85, 87, 111, 115, 118, 121, 122, 123, 133, 155, 158, 177, 178, 183, 185, 187, 201, 202, 203, 205, 213, 215, 217, 218, 221, 235, 237, 253, 278, 287, 301, 302, 303, 305, 321, 323, 327, 335, 355, 358, 371
Offset: 1

Views

Author

Zak Seidov, Jun 13 2005

Keywords

Comments

Complement of A107342 in the class of semiprimes.
This is to semiprimes A001358 as A034844 (Primes with nonprime digits) is to primes A000040. [Jonathan Vos Post, Jul 15 2010]

Crossrefs

Programs

  • Mathematica
    cnd[n_]:=Plus@@Last/@FactorInteger[n]==2&&Union[FreeQ[IntegerDigits[n], # ]&/@{4, 6, 9}]=={True};Select[Range[600], cnd[ # ]&]

Formula

{j in A001358 and j not in A179463}. [Jonathan Vos Post, Jul 15 2010]

A179463 Semiprimes A001358 containing at least one semiprime digit in base 10.

Original entry on oeis.org

4, 6, 9, 14, 26, 34, 39, 46, 49, 62, 65, 69, 74, 86, 91, 93, 94, 95, 106, 119, 129, 134, 141, 142, 143, 145, 146, 159, 161, 166, 169, 194, 206, 209, 214, 219, 226, 247, 249, 254, 259, 262, 265, 267, 274, 289, 291, 295, 298, 299, 309, 314, 319, 326, 329, 334, 339, 341
Offset: 1

Views

Author

Jonathan Vos Post, Jul 15 2010

Keywords

Comments

Semiprimes containing at least one 4, 6, or 9 digit base 10.
This is to semiprimes A001358 as A179336 is to primes A000040.
This properly includes the subset A107342 Semiprimes with semiprime digits.

Crossrefs

Cf. A107342 Semiprimes with semiprime digits (digits 4, 6, 9 only), A107665 Numbers with semiprime digits (digits 4, 6, 9 only), A107666 Primes with semiprime digits (digits 4, 6, 9 only), A111494, A111496, A111697, A108614 Semiprimes with non-semiprimes digits (no digits 4, 6, 9 in semiprimes), A179336.

Programs

  • Mathematica
    spdQ[n_]:=Module[{idn=IntegerDigits[n]},MemberQ[idn,4] || MemberQ[ idn,6] || MemberQ[ idn,9]]; Select[Select[Range[350],PrimeOmega[#]==2&],spdQ] (* Harvey P. Dale, Jun 24 2013 *)

Extensions

Corrected (a(37) added) by Harvey P. Dale, Jun 24 2013
Showing 1-8 of 8 results.