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

A034302 Zeroless primes that remain prime if any digit is deleted.

Original entry on oeis.org

23, 37, 53, 73, 113, 131, 137, 173, 179, 197, 311, 317, 431, 617, 719, 1499, 1997, 2239, 2293, 3137, 4919, 6173, 7433, 9677, 19973, 23833, 26833, 47933, 73331, 74177, 91733, 93491, 94397, 111731, 166931, 333911, 355933, 477797, 477977
Offset: 1

Views

Author

Keywords

Crossrefs

Programs

  • Haskell
    import Data.List (inits, tails)
    a034302 n = a034302_list !! (n-1)
    a034302_list = filter f $ drop 4 a038618_list where
       f x = all (== 1) $ map (a010051 . read) $
                 zipWith (++) (inits $ show x) (tail $ tails $ show x)
    -- Reinhard Zumkeller, Dec 17 2011
    
  • Mathematica
    rpnzQ[n_]:=Module[{idn=IntegerDigits[n]},Count[idn,0]==0 && And@@ PrimeQ[FromDigits/@ Subsets[IntegerDigits[n], {Length[idn]-1}]]]; Select[Prime[Range[40000]],rpnzQ]  (* Harvey P. Dale, Mar 24 2011 *)
  • PARI
    is(n)=my(d=digits(n),t=2^#d-1); if(vecmin(d)==0, return(0)); for(i=0,#d-1, if(!isprime(fromdigits(vecextract(d,t-2^i))), return(0))); isprime(n) \\ Charles R Greathouse IV, Jun 23 2017
    
  • Python
    from itertools import product
    from sympy import isprime
    A034302_list, m = [23, 37, 53, 73], 7
    for l in range(1,m-1): # generate all terms less than 10^m
        for d in product('123456789',repeat=l):
            for e in product('1379',repeat=2):
                s = ''.join(d+e)
                if isprime(int(s)):
                    for i in range(len(s)):
                        if not isprime(int(s[:i]+s[i+1:])):
                            break
                    else:
                        A034302_list.append(int(s)) # Chai Wah Wu, Apr 05 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

A034895 Dropping any digit gives a prime number.

Original entry on oeis.org

22, 23, 25, 27, 32, 33, 35, 37, 52, 53, 55, 57, 72, 73, 75, 77, 111, 113, 117, 119, 131, 137, 171, 173, 179, 197, 311, 317, 371, 411, 413, 417, 431, 437, 471, 473, 611, 617, 671, 711, 713, 719, 731, 1013, 1031, 1037, 1073, 1079, 1097, 1379, 1397, 1499, 1673
Offset: 1

Views

Author

Keywords

Comments

The prime terms are in A051362.
The number of terms < 10^n: 0, 16, 43, 101, 159, 267, 350, 476, 582, 751, ..., . - Robert G. Wilson v, Oct 09 2014
Includes 10*x+1 for x in A004022. - Robert Israel, Jan 14 2016

Examples

			1379 is in the sequence since 379, 179, 139 & 137 are all primes. - _Robert G. Wilson v_, Oct 07 2014
		

Crossrefs

Cf. A267413.

Programs

  • Mathematica
    fQ[n_] := Union[ PrimeQ[ Table[ Quotient[n, 10^k]*10^(k - 1) + Mod[n, 10^(k - 1)], {k, 1 + Floor@ Log10@ n}] ]] == {True}; Select[ Range@ 1675, fQ] (* Robert G. Wilson v, Oct 07 2014 *)
    ddpnQ[n_]:=With[{id=IntegerDigits[n]},AllTrue[Table[FromDigits[Drop[id,{i}]],{i,Length[id]}],PrimeQ]]; Select[Range[2000],ddpnQ] (* The program uses the AllTrue function from Mathematica version 10 *) (* Harvey P. Dale, Apr 12 2017 *)
  • PARI
    isok(n) = {d = digits(n); for (i=1, #d, nd = []; for (k=1, #d, if (k != i, nd = concat(nd, d[k]));); if (! isprime(subst(Pol(nd), x, 10)), return (0));); return (1);} \\ Michel Marcus, Jul 17 2014
    
  • PARI
    DroppingAnyDigitGivesAPrime(N,b) = {
    \\ Property-testing function; returns 1 if true for N, 0 otherwise
    \\ Works with any base b. Here usable with b=10.
      my(k=b,m); if(N=(k\b), m=(N\k)*(k\b)+(N%(k\b));
        if ((m<2)||(!isprime(m)),return(0)); k*=b);
      return(1);
    } \\ Stanislav Sykora, Jan 14 2016
    
  • Python
    from sympy import isprime
    def is_A034895(n):
        s = str(n)
        return n>9 and all(isprime(int(s[:i]+s[i+1:])) for i in range(len(s)))
    # David Radcliffe, Dec 11 2017

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

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
    

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

A059584 Triangle T(n,m) of number of labeled m-node T_0-hypergraphs with n hyperedges (empty hyperedges and multiple hyperedges included), m=0,1,...,2^n.

Original entry on oeis.org

1, 1, 1, 2, 2, 1, 3, 7, 12, 12, 1, 4, 16, 68, 292, 1120, 3360, 6720, 6720, 1, 5, 30, 235, 2251, 23520, 245280, 2412480, 21631680, 172972800, 1210809600, 7264857600, 36324288000, 145297152000, 435891456000, 871782912000, 871782912000
Offset: 0

Views

Author

Vladeta Jovovic, Goran Kilibarda, Jan 23 2001

Keywords

Comments

A hypergraph is a T_0 hypergraph if for every two distinct nodes there exists a hyperedge containing one but not the other node.

Examples

			Triangle starts:
1, 1;
1, 2, 2;
1, 3, 7, 12, 12;
1, 4, 16, 68, 292, 1120, 3360, 6720, 6720;
...
There are 7 2-node T_0-hypergraphs with 2 hyperedges: {{}, {1}}, {{}, {2}}, {{1}, {1}}, {{1}, {2}}, {{1}, {1, 2}}, {{2}, {2}} and {{2}, {1, 2}}.
		

Crossrefs

Cf. A059084, A051362 (=T(n,2)), A059585 (=T(n,3)), A059586 (row sums).

Formula

T(n,m) = Sum_{i=0..m} stirling1(m, i)*binomial(2^i+n-1, n).

A226108 Primes remaining prime if all but two digits are deleted.

Original entry on oeis.org

11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97, 113, 131, 137, 173, 179, 197, 311, 317, 431, 617, 719, 1117, 1171, 4111, 11113, 11117, 11119, 11131, 11171, 11173, 11197, 11311, 11317, 11719, 11731, 13171, 13711, 41113
Offset: 1

Views

Author

Tim Cieplowski, May 26 2013

Keywords

Comments

Subsequence of A069488.

Examples

			For a(3)=137, all pairs of two digits (in their original order) 13, 17, and 37 are prime.
		

References

  • C. Caldwell, Truncatable primes, J. Recreational Math., 19:1 (1987) 30-33.

Crossrefs

Programs

  • Mathematica
    testQ[n_] := n > 9 && Catch[Block[{d = IntegerDigits@n}, Do[If[! PrimeQ[ d[[j]] + 10*d[[i]]], Throw@False], {j, 2, Length@d}, {i, j-1}]; True]]; Select[Prime@ Range[10^5], testQ] (* Giovanni Resta, May 28 2013 *)

A244282 Consider a prime number p with m decimal digits. The sequence lists the primes p such that the prefix of length m-1 and the suffix of length m-1 are both prime numbers.

Original entry on oeis.org

23, 37, 53, 73, 113, 131, 137, 173, 179, 197, 311, 313, 317, 373, 379, 419, 431, 479, 613, 617, 619, 673, 719, 797, 971, 1013, 1019, 1031, 1097, 1277, 1373, 1499, 1571, 1733, 1811, 1997, 2113, 2239, 2293, 2719, 3079, 3137, 3313, 3373, 3491, 3499, 3593, 3673, 3677, 3733
Offset: 1

Views

Author

Michel Lagneau, Jun 25 2014

Keywords

Comments

Let x(0)x(1)... x(q-1)x(q) denote the decimal expansion of a prime p. The sequence lists the primes p such that the prefix x(0)x(1)... x(q-1) and the suffix x(1)... x(q-1)x(q) are primes.
Superset of A051362; a(n) first differs from A051362 when n=12.

Examples

			The prime number 179 is in the sequence because 17 and 79 are primes.
		

Crossrefs

Programs

  • Maple
    with(numtheory):
    for m from 1 to 200 do:
          n:=ithprime(m):x:=convert(n, base, 10):n1:=nops(x):
          s1:=sum('x[i]*10^(i-1) ', 'i'=1..n1-1):
          s2:=(n-irem(n,10))/10:
          if type(s1,prime)=true and type(s2,prime)=true
          then
            printf(`%d, `, n):
            else
          fi:
    od:
  • Mathematica
    Select[Prime[Range[1000]], (id = IntegerDigits[#]; PrimeQ[FromDigits[Take[id, {1, -2}]]] && PrimeQ[FromDigits[Take[id, {2, -1}]]]) &] (* César Eliud Lozada, Mar 31 2024 *)
    Select[Prime[Range[600]],With[{idp=IntegerDigits[#]},AllTrue[FromDigits/@{Rest[idp],Most[idp]},PrimeQ]]&] (* Harvey P. Dale, Feb 06 2025 *)

Extensions

Inserted missing term a(49) and corrected a(50) by Paolo P. Lava, Dec 04 2017

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
Showing 1-10 of 22 results. Next