login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A034302 Zeroless primes that remain prime if any digit is deleted. 15

%I #43 Jan 15 2024 19:04:02

%S 23,37,53,73,113,131,137,173,179,197,311,317,431,617,719,1499,1997,

%T 2239,2293,3137,4919,6173,7433,9677,19973,23833,26833,47933,73331,

%U 74177,91733,93491,94397,111731,166931,333911,355933,477797,477977

%N Zeroless primes that remain prime if any digit is deleted.

%H Chai Wah Wu, <a href="/A034302/b034302.txt">Table of n, a(n) for n = 1..118</a> (terms 1..79 from T. D. Noe, terms 80..103 from Charles R Greathouse IV)

%H StackExchange, <a href="http://math.stackexchange.com/questions/33094">Deleting any digit yields a prime</a>

%t 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 *)

%o (Haskell)

%o import Data.List (inits, tails)

%o a034302 n = a034302_list !! (n-1)

%o a034302_list = filter f $ drop 4 a038618_list where

%o f x = all (== 1) $ map (a010051 . read) $

%o zipWith (++) (inits $ show x) (tail $ tails $ show x)

%o -- _Reinhard Zumkeller_, Dec 17 2011

%o (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

%o (Python)

%o from itertools import product

%o from sympy import isprime

%o A034302_list, m = [23, 37, 53, 73], 7

%o for l in range(1,m-1): # generate all terms less than 10^m

%o for d in product('123456789',repeat=l):

%o for e in product('1379',repeat=2):

%o s = ''.join(d+e)

%o if isprime(int(s)):

%o for i in range(len(s)):

%o if not isprime(int(s[:i]+s[i+1:])):

%o break

%o else:

%o A034302_list.append(int(s)) # _Chai Wah Wu_, Apr 05 2021

%Y Cf. A034303, A034304, A034305, A051362, A010051, A038618.

%K base,nonn,nice

%O 1,1

%A _David W. Wilson_

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified July 7 07:19 EDT 2024. Contains 374063 sequences. (Running on oeis4.)