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 14 results. Next

A051362 Primes remaining prime if any digit is deleted (zeros allowed).

Original entry on oeis.org

23, 37, 53, 73, 113, 131, 137, 173, 179, 197, 311, 317, 431, 617, 719, 1013, 1031, 1097, 1499, 1997, 2239, 2293, 3137, 4019, 4919, 6173, 7019, 7433, 9677, 10193, 10613, 11093, 19973, 23833, 26833, 30011, 37019, 40013, 47933, 73331, 74177
Offset: 1

Views

Author

Harvey P. Dale, May 31 2000

Keywords

Comments

These might be called "super-prime numbers". - Jaime Gutierrez (jgutierrez(AT)matematicas.net), Sep 27 2007
A proper subset of A034895. - Robert G. Wilson v, Oct 12 2014
The largest known number in this sequence is a 274-digit prime consisting of 163 4s, followed by 80 0s, followed by 31 1s. See the CodeGolf link. - Dmitry Kamenetsky, Feb 26 2021

Crossrefs

Programs

  • Haskell
    import Data.List (inits, tails)
    a051362 n = a051362_list !! (n-1)
    a051362_list = filter p $ drop 4 a000040_list where
       p x = all (== 1) $ map (a010051 . read) $
                 zipWith (++) (inits $ show x) (tail $ tails $ show x)
    -- Reinhard Zumkeller, Dec 17 2011, Aug 24 2011
    
  • Mathematica
    rpQ[n_]:=Module[{idn=IntegerDigits[n]},And@@PrimeQ[FromDigits/@ Subsets[ IntegerDigits[ n],{Length[idn]-1}]]]; Select[Prime[Range[40000]], rpQ]
    prpQ[n_]:=AllTrue[FromDigits/@Table[Delete[IntegerDigits[n],d],{d,IntegerLength[ n]}],PrimeQ]; Select[Prime[Range[7500]],prpQ] (* Requires Mathematica version 10 or later *) (* Harvey P. Dale, Nov 27 2020 *)
  • PARI
    is(n)=my(v=Vec(Str(n)),k);for(i=1, #v, k=eval(concat(vecextract(v, 2^#v-1-2^(i-1))));if(!isprime(k),return(0)));isprime(n) \\ Charles R Greathouse IV, Oct 05 2011
    
  • Python
    from sympy import isprime
    def ok(n):
        if n < 10 or not isprime(n): return False
        s = str(n)
        return all(isprime(int(s[:i]+s[i+1:])) for i in range(len(s)))
    print([k for k in range(10**5) if ok(k)]) # Michael S. Branicky, Nov 02 2023
  • Sage
    def is_A051362(n):
        prime = is_prime(n)
        if prime:
            L = ZZ(n).digits(10)
            for k in range(len(L)):
                K = L[:]; del K[k]
                prime = is_prime(ZZ(K, base=10))
                if not prime: break
        return prime
    A051362_list = lambda n: filter(is_A051362, range(n))
    A051362_list(77777) # Peter Luschny, Jul 17 2014
    

A034305 Zeroless nonprimes that remain nonprime if any digit is deleted.

Original entry on oeis.org

14, 16, 18, 44, 46, 48, 49, 64, 66, 68, 69, 81, 84, 86, 88, 91, 94, 96, 98, 99, 122, 124, 125, 126, 128, 142, 144, 145, 146, 148, 152, 154, 155, 156, 158, 162, 164, 165, 166, 168, 182, 184, 185, 186, 188, 212, 214, 215, 216, 218, 221, 222, 224, 225, 226, 228
Offset: 1

Views

Author

Keywords

Crossrefs

Subsequence of A052382.

Programs

  • Haskell
    a034305 n = a034305_list !! (n-1)
    a034305_list = filter f $ drop 9 a052382_list where
      f x = a010051' x == 0 &&
            (all (== 0) $ map (a010051' . read) $
             zipWith (++) (inits $ show x) (tail $ tails $ show x))
    -- Reinhard Zumkeller, May 10 2015
    
  • Mathematica
    npQ[n_]:=!PrimeQ[n]&&FreeQ[IntegerDigits[n],0]&&AllTrue[FromDigits/@ Table[Drop[IntegerDigits[n],{k}],{k,IntegerLength[n]}],!PrimeQ[#]&]; Select[Range[10,300],npQ](* Requires Mathematica version 10 or later *) (* Harvey P. Dale, Jun 19 2021 *)
  • PARI
    is(n)=my(d=digits(n)); if(#d<2 || vecmin(d)<1 || isprime(n), return(0)); for(i=0,#d-1, if(isprime(fromdigits(vecextract(d,2^#d-1-2^i))), return(0))); 1 \\ Charles R Greathouse IV, Jun 25 2017
    
  • Python
    from sympy import isprime
    def ok(n):
        if n < 10 or isprime(n): return False
        s = str(n)
        return "0" not in s and not any(isprime(int(s[:i]+s[i+1:])) for i in range(len(s)))
    print([k for k in range(229) if ok(k)]) # Michael S. Branicky, Jan 15 2023

Extensions

Definition corrected by T. D. Noe, Apr 02 2008
Single-digit terms removed again by Georg Fischer, Jun 21 2021

A057876 Primes p with the following property: let d_1, d_2, ... be the distinct digits occurring in the decimal expansion of p. Then for each d_i, dropping all the digits d_i from p produces a prime number. Leading 0's are not allowed.

Original entry on oeis.org

23, 37, 53, 73, 113, 131, 137, 151, 173, 179, 197, 211, 311, 317, 431, 617, 719, 1531, 1831, 1997, 2113, 2131, 2237, 2273, 2297, 2311, 2797, 3137, 3371, 4337, 4373, 4733, 4919, 6173, 7297, 7331, 7573, 7873, 8191, 8311, 8831, 8837, 12239, 16673, 19531
Offset: 1

Views

Author

Patrick De Geest, Oct 15 2000

Keywords

Examples

			1531 gives primes 53, 131 and 151 after dropping digits 1, 5 and 3.
A larger example 1210778071 gives primes 12177871, 2077807, 110778071, 1210801 and 121077071 after dropping digits 0, 1, 2, 7 and 8.
		

Crossrefs

Programs

  • Maple
    filter:= proc(n) local L,d,Lp;
      if not isprime(n) then return false fi;
      L:= convert(n,base,10);
      for d in convert(L,set) do
        Lp:= subs(d=NULL,L);
        if Lp=[] or Lp[-1] = 0 then return false fi;
        if not isprime(add(Lp[i]*10^(i-1),i=1..nops(Lp))) then return false fi;
      od;
      true
    end proc:
    select(filter, [seq(i,i=13..20000,2)]); # Robert Israel, Jul 13 2018

Extensions

Name edited by Robert Israel, Jul 13 2018

A057883 Smallest possible prime with at least n (from 2 to 10) distinct digits that remains prime (leading zeros not allowed) when all occurrences of its digits d are deleted.

Original entry on oeis.org

23, 137, 6173, 37019, 5600239, 476710937, 8192454631, 1645957688093, 78456580281239
Offset: 2

Views

Author

Patrick De Geest, Oct 15 2000

Keywords

Examples

			5600239 is a solution for at least 6 digits because 56239, 560039, 560029, 600239, 500239 and 560023 are all primes.
		

Crossrefs

Extensions

More terms from Giovanni Resta, Feb 15 2006

A034304 Nonprime; becomes prime if any digit is deleted (zeros not allowed in the number).

Original entry on oeis.org

22, 25, 27, 32, 33, 35, 52, 55, 57, 72, 75, 77, 111, 117, 119, 171, 371, 411, 413, 417, 437, 471, 473, 611, 671, 711, 713, 731, 1379, 1397, 1673, 1739, 1937, 1991, 2233, 2277, 2571, 2577, 2811, 3113, 3131, 3173, 3311, 3317, 3479, 4199, 4331, 4433, 4439
Offset: 1

Views

Author

Keywords

Comments

From David A. Corneth, Sep 14 2019: (Start)
Terms can't contain digits of the form 0 (mod 3), 1 (mod 3) and 2 (mod 3) as then one can remove a digit to get a multiple of 3. Classifying digits mod 3 could give further restrictions on the frequency of digits per class.
For example, let (d0, d1, d2) be the frequency of digits from each residue class mod 3 respectively. Then a term can't be of the form (0, 2, 3) as removing a digit from the class 2 (mod 3) gives a multiple of 3. (End)

Crossrefs

Programs

  • Haskell
    a034304 n = a034304_list !! (n-1)
    a034304_list = map read $ filter (f "") $
                   map show $ dropWhile (< 10) a259315_list :: [Integer] where
       f _ "" = True
       f us (v:vs) = a010051' (read (us ++ vs)) == 1 && f (us ++ [v]) vs
    -- Reinhard Zumkeller, Jun 24 2015
  • Mathematica
    With[{nn=5000},Select[Complement[Range[10,nn],Prime[Range[ PrimePi[ nn]]]], DigitCount[#,10,0]==0&&And@@PrimeQ[FromDigits/@Subsets[ IntegerDigits[#],{IntegerLength[#]-1}]]&]] (* Harvey P. Dale, Apr 06 2012 *)

Extensions

Definition corrected by T. D. Noe, Apr 02 2008

A034303 Zeroless primes that become nonprime if any digit is deleted.

Original entry on oeis.org

11, 19, 41, 61, 89, 227, 251, 257, 277, 281, 349, 449, 499, 521, 557, 577, 587, 727, 757, 787, 821, 827, 857, 877, 881, 887, 991, 1117, 1129, 1171, 1187, 1259, 1289, 1423, 1447, 1453, 1471, 1483, 1543, 1553, 1559, 1583, 1621, 1669, 1721, 1741, 1747
Offset: 1

Views

Author

Keywords

Crossrefs

Programs

  • Haskell
    import Data.List (inits, tails)
    a034303 n = a034303_list !! (n-1)
    a034303_list = filter f $ drop 4 a038618_list where
       f x = all (== 0) $ map (a010051 . read) $
                 zipWith (++) (inits $ show x) (tail $ tails $ show x)
    -- Reinhard Zumkeller, Dec 17 2011
  • Mathematica
    Select[Prime[Range[5,300]],Union[PrimeQ[FromDigits/@Table[Delete[ IntegerDigits[ #], n],{n,IntegerLength[#]}]]] == {False} && !MemberQ[ IntegerDigits[#],0]&] (* Harvey P. Dale, Jan 09 2014 *)

Extensions

Definition corrected by T. D. Noe, Apr 02 2008
Name edited by Jon E. Schoenfield, Feb 07 2022

A248642 Odious numbers (A000069) remaining odious if any digit is deleted (zeros allowed).

Original entry on oeis.org

11, 14, 21, 22, 28, 41, 42, 44, 47, 74, 81, 82, 84, 87, 88, 131, 161, 164, 191, 193, 194, 211, 256, 261, 262, 321, 322, 328, 352, 355, 381, 382, 388, 419, 421, 422, 491, 494, 502, 522, 552, 555, 569, 611, 614, 641, 642, 644, 647, 704, 744, 749, 764, 769, 793
Offset: 1

Views

Author

Vladimir Shevelev, Oct 10 2014

Keywords

Comments

An analog of the idea Wilson-Dale: A034302, A051362.

Examples

			161 is in the sequence, since the numbers 161,61,11,16 are odious.
		

Crossrefs

Programs

  • Mathematica
    odiousQ:=OddQ[First[DigitCount[#,2]]]&;
    Select[Range[1000],odiousQ[#]&&Apply[And,Map[odiousQ[FromDigits[#]]&,Subsets[#,{Length[#]-1}]&[IntegerDigits[#]]]]&] (* Peter J. C. Moses, Oct 10 2014 *)

Extensions

More terms from Peter J. C. Moses, Oct 10 2014

A057877 a(n) = smallest n-digit prime in A057876.

Original entry on oeis.org

23, 113, 1531, 12239, 111317, 1111219, 11119291, 111111197, 1111113173, 11111133017, 111111189919, 1111111411337, 11111111161177, 111111111263311, 1111111111149119, 11111111111179913, 111111111111118771, 1111111111111751371, 11111111111111111131, 111111111111113129773, 1111111111111111337111
Offset: 2

Views

Author

Patrick De Geest, Oct 15 2000

Keywords

Examples

			1531 gives primes 53, 131 and 151 after dropping digits 1, 5 and 3.
		

Crossrefs

Programs

  • Maple
    filter:= proc(n) local L,d,Lp;
      if not isprime(n) then return false fi;
      L:= convert(n,base,10);
      for d in convert(L,set) do
        Lp:= subs(d=NULL,L);
        if Lp=[] or Lp[-1] = 0 then return false fi;
        if not isprime(add(Lp[i]*10^(i-1),i=1..nops(Lp))) then return false fi;
      od;
      true
    end proc:
    Res:= NULL:
    for t from 1 to 21 do
      for x from (10^(t+1)-1)/9 by 2 do
        if filter(x) then Res:= Res, x; break fi
      od
    od:
    Res; # Robert Israel, Jul 13 2018
  • Mathematica
    Do[k = (10^n - 1)/9; While[d = IntegerDigits[k]; !PrimeQ[k] || !PrimeQ[ FromDigits[ DeleteCases[d, 0]]] || !PrimeQ[ FromDigits[ DeleteCases[d, 1]]] || !PrimeQ[ FromDigits[ DeleteCases[d, 2]]] || !PrimeQ[ FromDigits[ DeleteCases[d, 3]]] || !PrimeQ[ FromDigits[ DeleteCases[d, 4]]] || !PrimeQ[ FromDigits[ DeleteCases[d, 5]]] || !PrimeQ[ FromDigits[ DeleteCases[d, 6]]] || !PrimeQ[ FromDigits[ DeleteCases[d, 7]]] || !PrimeQ[ FromDigits[ DeleteCases[d, 8]]] || !PrimeQ[ FromDigits[ DeleteCases[d, 9]]], k++ ]; Print[k], {n, 2, 19}]

Extensions

Extended by Robert G. Wilson v, Dec 17 2002
More terms from Robert Israel, Jul 13 2018

A057880 Primes with 4 distinct digits that remain prime (no leading zeros allowed) after deleting all occurrences of its digits d.

Original entry on oeis.org

6173, 12239, 16673, 19531, 19973, 21613, 22397, 22937, 34613, 36137, 47933, 51193, 54493, 56519, 56531, 56591, 69491, 69497, 72937, 76873, 93497, 96419, 96479, 96497, 98837, 112939, 118213, 131779, 143419, 144497, 159319, 163337
Offset: 1

Views

Author

Patrick De Geest, Oct 15 2000

Keywords

Crossrefs

Programs

  • Maple
    filter:= proc(L) local d,Lp,i;
          if L[-1]=0 then return false fi;
          if not isprime(add(L[i]*10^(i-1),i=1..nops(L))) then return false fi;
          for d in convert(L,set) do
            Lp:= remove(`=`,L,d);
            if Lp[-1] = 0 or not isprime(add(Lp[i]*10^(i-1),i=1..nops(Lp))) then return false fi;
          od;
          true
    end proc:
    getCands:= proc(n, m) option remember;
       if m = 1 then return [seq([d$n], d=0..9)] fi;
       if n < m then return [] fi;
       [seq(seq([i,op(L)],i= {$0..9} minus convert(L,set)),L = procname(n-1,m-1)),
        seq(seq([i,op(L)],i=convert(L,set)),L = procname(n-1,m))]
    end proc:
    [seq(op(sort(map(t->add(t[i]*10^(i-1),i=1..nops(t)),select(filter,getCands(d,4))))),d=4..6)]; # Robert Israel, Jan 19 2017
  • Mathematica
    p4dQ[n_]:=Module[{idn=IntegerDigits[n]},Count[idn,0]==0 && Count[ DigitCount[ n],0]==6&&AllTrue[FromDigits/@Table[DeleteCases[idn,k],{k,Union[idn]}],PrimeQ]]; Select[Prime[Range[ 15000]],p4dQ] (* The program uses the AllTrue function from Mathematica version 10 *) (* Harvey P. Dale, Sep 30 2017 *)

Extensions

Offset changed by Robert Israel, Jan 19 2017

A057882 Primes with 6 distinct digits that remain prime (no leading zeros allowed) after deleting all occurrences of its digits d.

Original entry on oeis.org

5600239, 21066319, 42209639, 63019679, 82190131, 95422517, 113420491, 114248737, 130194791, 132863191, 135160339, 137697019, 145136591, 145611439, 146414839, 153160517, 159136291, 181680713, 186601339, 186609331, 190714133
Offset: 1

Views

Author

Patrick De Geest, Oct 15 2000

Keywords

Crossrefs

Extensions

Offset changed by Andrew Howroyd, Aug 14 2024
Showing 1-10 of 14 results. Next