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!)
A305352 Deletable primes (A080608) under the stricter rule that leading zeros are disallowed. 3

%I #44 Jan 28 2023 12:11:24

%S 2,3,5,7,13,17,23,29,31,37,43,47,53,59,67,71,73,79,83,97,103,107,113,

%T 127,131,137,139,157,163,167,173,179,193,197,223,229,233,239,263,269,

%U 271,283,293,307,311,313,317,331,337,347,353,359,367,373,379,383,397,431,433,439

%N Deletable primes (A080608) under the stricter rule that leading zeros are disallowed.

%C Subset of A080608. Numbers 2003, 2017, 2053, 3023, ... are in A080608 but not here.

%C If you start from a one-digit prime, you can try to build larger and larger deletable primes by inserting digits. If at one point you get stuck and cannot enlarge the number, you have reached a non-insertable prime (A125001). - _Jeppe Stig Nielsen_, Mar 28 2021

%H Jeppe Stig Nielsen, <a href="/A305352/b305352.txt">Table of n, a(n) for n = 1..10000</a>

%e 2003 is not a member since removing a digit will either give 003 which has a leading zero, or give one of the numbers 203 or 200 which are both composite. However, 2003 is in A080608 because all of 2003, 003, 03, 3 are prime.

%t Rest@ Union@ Nest[Function[{a, p}, Append[a, With[{w = IntegerDigits[p]}, If[# == True, p, 0] &@ AnyTrue[Array[If[First@ # == 0, 1, FromDigits@ #] &@ Delete[w, #] &, Length@ w], ! FreeQ[a, #] &]]]] @@ {#, Prime[Length@ # + 1]} &, Prime@ Range@ PrimePi@ 10, 81] (* _Michael De Vlieger_, Aug 02 2018 *)

%o (PARI) is(n) = !ispseudoprime(n)&&return(0);my(d=digits(n));#d==1&&return(1);for(i=1,#d,my(v=vecextract(d,Str("^"i)));v[1]!=0&&is(fromdigits(v))&&return(1));0

%o (Python)

%o from sympy import isprime

%o def ok(n):

%o if not isprime(n): return False

%o if n < 10: return True

%o s = str(n)

%o si = (s[:i]+s[i+1:] for i in range(len(s)))

%o return any(t[0] != '0' and ok(int(t)) for t in si)

%o print([k for k in range(440) if ok(k)]) # _Michael S. Branicky_, Jan 28 2023

%Y Cf. A080608, A080603, A096235-A096246, A125001, A322474.

%K nonn,base

%O 1,1

%A _Jeppe Stig Nielsen_, Aug 01 2018

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 August 21 00:13 EDT 2024. Contains 375342 sequences. (Running on oeis4.)