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.

Previous Showing 31-40 of 105 results. Next

A213304 Smallest number with n nonprime substrings (Version 3: substrings with leading zeros are counted as nonprime if the corresponding number is not a prime).

Original entry on oeis.org

2, 1, 10, 14, 101, 104, 144, 1001, 1014, 1044, 1444, 10010, 10014, 10144, 10444, 14444, 100120, 100104, 100144, 101444, 104444, 144444, 1000144, 1001040, 1001044, 1001444, 1014444, 1044444, 1444444, 10001044, 10001444, 10010404, 10010444, 10014444, 10144444, 10444444, 14444444, 100010404, 100010444, 100014444, 100104044, 100104444, 100144444, 101444444, 104444444, 144444444
Offset: 0

Views

Author

Hieronymus Fischer, Aug 26 2012

Keywords

Comments

The sequence is well defined since for each n >= 0 there is a number with n nonprime substrings.
Different from A213303, first difference is at a(16).

Examples

			a(0)=2, since 2 is the least number with zero nonprime substrings.
a(1)=1, since 1 has 1 nonprime substrings.
a(2)=10, since 10 is the least number with 2 nonprime substrings, these are 1 and 10 ('0' will not be counted).
a(3)=14, since 14 is the least number with 3 nonprime substrings, these are 1 and 4 and 14. 10, 11 and 12 only have 2 such substrings.
		

Crossrefs

Formula

a(m(m+1)/2) = (13*10^(m-1)-4)/9, m>0.
With b(n):=floor((sqrt(8*n-7)-1)/2):
a(n) > 10^b(n), for n>2, a(n) = 10^b(n) for n=1,2.
a(n) >= 10^b(n)+4*10^(n-1-b(n)(b(n)+1)/2)-1)/9, equality holds if n or n+1 is a triangular number > 0 (cf. A000217).
a(n) >= A213303(n).
a(n) <= A213307(n).

A378081 Primes that remain prime if any two of their digits are deleted.

Original entry on oeis.org

223, 227, 233, 257, 277, 337, 353, 373, 523, 557, 577, 727, 733, 757, 773, 1117, 1171, 4111
Offset: 1

Views

Author

Enrique Navarrete, Nov 15 2024

Keywords

Comments

Any term >= 1000 must have its last three digits be from {1, 3, 7, 9}. - Michael S. Branicky, Nov 15 2024
From David A. Corneth, Nov 16 2024: (Start)
Any term < 1000 has exactly three digits and all digits prime (cf. A019546).
Any term >= 1000 is of the form 100*p + r where p is prime and r has only digits coprime to 10 and 11 <= r <= 99.
Also digits in any term >= 1000 are from {1, 4, 7} and at most one digit from {2, 5, 8}. Else at least one of the numbers resulting from removing any two digits is a multiple of 3 and not 3 itself so not prime.
a(19) >= 10^9 if it exists. (End)
a(19) >= 10^10 if it exists. - Michael S. Branicky, Nov 16 2024
a(19) >= 10^100 if it exists. - David A. Corneth, Nov 18 2024

Examples

			From _David A. Corneth_, Nov 18 2024: (Start)
4111 is a term since 4111 is prime and removing any to digits from it gives 11 or 11 or 11 or 41 or 41 or 41 and all of those are prime.
No term can end in 12587 as by removing we can (among other numbers) obtain 287, 127, 128, 157, 158, 257 and 587 which are respectively 0 through 6 (mod 7) (all possible residue classes mod 7). So by prepending more digits to 12587 we can always get a multiple of 7 (that is larger than 7) after removing some two digits. (End)
		

Crossrefs

Programs

  • Mathematica
    q[n_] := Module[{d = IntegerDigits[n], nd}, nd = Length[d]; nd > 2 && AllTrue[FromDigits /@ Map[d[[#]] &, Subsets[Range[nd], {nd - 2}]], PrimeQ]]; Select[Prime[Range[600]], q] (* Amiram Eldar, Nov 16 2024 *)
  • PARI
    \\ See Corneth link
  • Python
    from sympy import isprime
    from itertools import combinations as C
    def ok(n):
        if n < 100 or not isprime(n): return False
        s = str(n)
        return all(isprime(int(t)) for i, j in C(range(len(s)), 2) if (t:=s[:i]+s[i+1:j]+s[j+1:])!="")
    print([k for k in range(1, 10**6) if ok(k)]) # Michael S. Branicky, Nov 15 2024
    

A082755 Smaller of a pair of consecutive primes having only prime digits.

Original entry on oeis.org

2, 3, 5, 223, 727, 3253, 3727, 5233, 5323, 7573, 7723, 7753, 22273, 23327, 25523, 27733, 32233, 32323, 32533, 35323, 35533, 37253, 37273, 52223, 52727, 53323, 53327, 53773, 55333, 72223, 72727, 75223, 75527, 75553, 222527, 222533, 222553, 223273, 223753, 225223
Offset: 1

Views

Author

Amarnath Murthy, Apr 18 2003

Keywords

Examples

			223 is a term as the next prime 227 also has only prime digits.
		

Crossrefs

Programs

  • Mathematica
    NextPrim[n_] := Block[{k = n + 1}, While[ !PrimeQ[k], k++ ]; k]; p = 0; q = 1; pd = {1}; Do[p = q; pd = qd; q = NextPrim[p]; qd = Union[ Join[{2, 3, 5, 7}, IntegerDigits[q]]]; If[pd == qd == {2, 3, 5, 7}, Print[p]], {n, 1, 20000}]
    Prime[#]&/@SequencePosition[Table[If[AllTrue[IntegerDigits[n],PrimeQ],1,0],{n,Prime[Range[20000]]}],{1,1}][[All,1]] (* Requires Mathematica version 10 or later *) (* Harvey P. Dale, Aug 31 2017 *)
  • Python
    from sympy import nextprime, isprime
    from itertools import count, islice, product
    def onlypd(n): return set(str(n)) <= set("2357")
    def agen():
        yield from [2, 3, 5]
        for digits in count(2):
            for p in product("2357", repeat=digits-1):
                for end in "37":
                    t = int("".join(p) + end)
                    if isprime(t) and onlypd(nextprime(t)):
                        yield t
    print(list(islice(agen(), 40))) # Michael S. Branicky, Mar 11 2022

Extensions

Edited and extended by Robert G. Wilson v, Apr 22 2003

A092626 Primes with one nonprime digit.

Original entry on oeis.org

13, 17, 29, 31, 43, 47, 59, 67, 71, 79, 83, 97, 127, 137, 157, 173, 229, 239, 251, 263, 271, 283, 293, 307, 313, 317, 331, 347, 359, 367, 379, 383, 397, 433, 457, 503, 521, 547, 563, 571, 587, 593, 653, 673, 677, 739, 743, 751, 787, 797, 823, 827, 853, 857
Offset: 1

Views

Author

Jani Melik, Apr 11 2004

Keywords

Comments

Heuristically, there are 15/(8 log 10) * n^(log_10 4) members up to n, or about 0.814 * n^0.602.

Examples

			13 is prime and it has one nonprime digit, 1;
3259 is prime and it has one nonprime digit, 9.
		

Crossrefs

Cf. A019546.

Programs

  • Maple
    stev_sez:=proc(n) local i, tren, st, ans, anstren; ans:=[ ]: anstren:=[ ]: tren:=n: for i while (tren>0) do st:=round( 10*frac(tren/10) ): ans:=[ op(ans), st ]: tren:=trunc(tren/10): end do; for i from nops(ans) to 1 by -1 do anstren:=[ op(anstren), op(i,ans) ]; od; RETURN(anstren); end:
    ts_stnepf:=proc(n) local i, stpf, ans; ans:=stev_sez(n): stpf:=0: for i from 1 to nops(ans) do if (isprime(op(i,ans))='false') then stpf:=stpf+1; # number of nonprime digits fi od; RETURN(stpf) end:
    ts_pr_neprn:=proc(n) local i, stpf, ans, ans1, tren; ans:=[ ]: stpf:=0: tren:=1: for i from 1 to n do if ( isprime(i)='true' and ts_stnepf(i) = 1) then ans:=[ op(ans), i ]: tren:=tren+1; fi od; RETURN(ans) end: ts_pr_neprn(4000);
  • Mathematica
    Select[Prime[Range[200]],Count[IntegerDigits[#],?(!PrimeQ[#]&)]==1&] (* _Harvey P. Dale, Feb 18 2018 *)

Extensions

Edited by R. J. Mathar, Nov 02 2009
Comment from Charles R Greathouse IV, Mar 19 2010

A152312 Primes without odd prime digits.

Original entry on oeis.org

2, 11, 19, 29, 41, 61, 89, 101, 109, 149, 181, 191, 199, 211, 229, 241, 269, 281, 401, 409, 419, 421, 449, 461, 491, 499, 601, 619, 641, 661, 691, 809, 811, 821, 829, 881, 911, 919, 929, 941, 991, 1009, 1019, 1021, 1049, 1061
Offset: 1

Views

Author

Omar E. Pol, Dec 02 2008

Keywords

Crossrefs

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

A124673 Numbers with distinct prime digits.

Original entry on oeis.org

2, 3, 5, 7, 23, 25, 27, 32, 35, 37, 52, 53, 57, 72, 73, 75, 235, 237, 253, 257, 273, 275, 325, 327, 352, 357, 372, 375, 523, 527, 532, 537, 572, 573, 723, 725, 732, 735, 752, 753, 2357, 2375, 2537, 2573, 2735, 2753, 3257, 3275, 3527, 3572, 3725, 3752, 5237
Offset: 1

Views

Author

Tanya Khovanova, Dec 24 2006

Keywords

Crossrefs

Programs

  • Mathematica
    Select[Range[10000], Length[IntegerDigits[ # ]] == Length[Union[IntegerDigits[ # ]]] && Complement[IntegerDigits[ # ], {2, 3, 5, 7}] == {} &]
    Rest[FromDigits/@Flatten[Permutations/@Subsets[{2,3,5,7}],1]]//Sort (* Harvey P. Dale, Jun 02 2024 *)

A124888 Primes with prime number of only prime digits (i.e., 2, 3, 5, 7).

Original entry on oeis.org

23, 37, 53, 73, 223, 227, 233, 257, 277, 337, 353, 373, 523, 557, 577, 727, 733, 757, 773, 22273, 22277, 22573, 22727, 22777, 23227, 23327, 23333, 23357, 23537, 23557, 23753, 23773, 25237, 25253, 25357, 25373, 25523, 25537, 25577, 25733, 27253, 27277
Offset: 1

Views

Author

Lekraj Beedassy, Nov 12 2006

Keywords

Crossrefs

Programs

  • Mathematica
    Select[Prime[Range[3000]],ContainsOnly[IntegerDigits[#],{2,3,5,7}]&&PrimeQ[Length[IntegerDigits[#]]]&] (* James C. McMahon, Dec 14 2024 *)
  • PARI
    isok(p) = isprime(p) && (d=digits(p)) && isprime(#d) && vecmin(vector(#d, k, isprime(d[k]))); \\ Michel Marcus, Sep 21 2017
    
  • Python
    from sympy import isprime, prime
    from itertools import count, islice, product
    def agen(): yield from filter(isprime, (int("".join(s)+e) for i in count(1) for s in product("2357", repeat=prime(i)-1) for e in "37"))
    print(list(islice(agen(), 42))) # Michael S. Branicky, Jun 23 2022

Extensions

Terms 773, 23753 inserted by Georg Fischer, Jun 23 2022

A213303 Smallest number with n nonprime substrings (Version 2: substrings with leading zeros are counted as nonprime if the corresponding number is > 0).

Original entry on oeis.org

2, 1, 10, 14, 101, 104, 144, 1001, 1014, 1044, 1444, 10010, 10014, 10144, 10444, 14444, 100101, 100104, 100144, 101444, 104444, 144444, 1000144, 1001014, 1001044, 1001444, 1014444, 1044444, 1444444, 10001044, 10001444, 10010144, 10010444, 10014444, 10144444, 10444444, 14444444, 100010144
Offset: 0

Views

Author

Hieronymus Fischer, Aug 26 2012

Keywords

Comments

The sequence is well defined since for each n >= 0 there is a number with n nonprime substrings.
Different from A213304, first different term is a(16).

Examples

			a(0)=2, since 2 is the least number with zero nonprime substrings.
a(1)=1, since 1 has 1 nonprime substrings.
a(2)=10, since 10 is the least number with 2 nonprime substrings, these are 1 and 10 ('0' will not be counted).
a(3)=14, since 14 is the least number with 3 nonprime substrings, these are 1 and 4 and 14. 10, 11 and 12 only have 2 such substrings.
		

Crossrefs

Formula

a(m(m+1)/2) = (13*10^(m-1)-4)/9, m>0.
With b(n):=floor((sqrt(8*n-7)-1)/2):
a(n) > 10^b(n), for n>2, a(n) = 10^b(n) for n=1,2.
a(n) >= 10^b(n)+4*10^(n-1-b(n)(b(n)+1)/2)-1)/9, equality holds if n or n+1 is a triangular number > 0 (cf. A000217).
a(n) <= A213304(n).
a(n) <= A213306(n).

A213306 Minimal prime with n nonprime substrings (Version 2: substrings with leading zeros are counted as nonprime if the corresponding number is > 0).

Original entry on oeis.org

2, 13, 11, 103, 101, 149, 1009, 1021, 1049, 1481, 10039, 10069, 10169, 11681, 14669, 100109, 100189, 100169, 101681, 104681, 146669, 1000669, 1001041, 1001081, 1004669, 1014469, 1046849, 1468469, 10001081, 10004669, 10010851
Offset: 0

Views

Author

Hieronymus Fischer, Aug 26 2012

Keywords

Examples

			a(0) = 2, since 2 is the least number with zero nonprime substrings.
a(1) = 13, since 13 has 1 nonprime substring (=’1’).
a(2) = 11, since 11 is the least number with 2 nonprime substrings (= 2 times ‘1’).
a(3) = 103, since 103 is the least number with 3 nonprime substrings, these are ‘1’ and ‘10’ and ‘03’ (‘0’ is not a valid substring in version 2).
		

Crossrefs

Formula

a(n) > 10^floor((sqrt(8*n+1)-1)/2), for n>2.
a(n) >= A213303(n).
a(n) <= A213307(n).
Previous Showing 31-40 of 105 results. Next