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

 


Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A080608 Deletable primes: primes such that removing some digit leaves either the empty string or another deletable prime (possibly preceded by some zeros). 44

%I #37 Jan 28 2023 12:10:16

%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: primes such that removing some digit leaves either the empty string or another deletable prime (possibly preceded by some zeros).

%C Subsequence of A179336. - _Reinhard Zumkeller_, Jul 11 2010

%C Leading zeros are allowed in the number that appears after the digit is deleted. For example the prime 100003 is deletable because of the sequence 00003, 0003, 003, 03, 3 consists of primes. Because of this, it appears that deletable primes are relatively common in the region just above a power of ten. For example 10^1000 + 2713 is a deletable prime. - _Jeppe Stig Nielsen_, Aug 01 2018

%C For a version that does not allow leading zeros, see A305352. - _Jeppe Stig Nielsen_, Aug 01 2018

%H David W. Wilson, <a href="/A080608/b080608.txt">Table of n, a(n) for n = 1..10000</a>

%H Eric Weisstein's World of Mathematics, <a href="http://mathworld.wolfram.com/DeletablePrime.html">Deletable Prime</a>

%e 410256793 is a deletable prime since each member of the sequence 410256793, 41256793, 4125673, 415673, 45673, 4567, 467, 67, 7 is prime (Weisstein, Caldwell).

%p read("transforms"):

%p isA080608 := proc(n)

%p option remember;

%p local dgs,i ;

%p if isprime(n) then

%p if n < 10 then

%p true;

%p else

%p dgs := convert(n,base,10) ;

%p for i from 1 to nops(dgs) do

%p subsop(i=NULL,dgs) ;

%p digcatL(ListTools[Reverse](%)) ;

%p if procname(%) then

%p return true;

%p end if;

%p end do:

%p false ;

%p end if;

%p else

%p false;

%p end if;

%p end proc:

%p n := 1;

%p for i from 1 to 500 do

%p p := ithprime(i) ;

%p if isA080608(p) then

%p printf("%d %d\n",n,p) ;

%p n := n+1 ;

%p fi ;

%p end do: # _R. J. Mathar_, Oct 11 2014

%t Rest@ Union@ Nest[Function[{a, p}, Append[a, With[{w = IntegerDigits[p]}, If[# == True, p, 0] &@ AnyTrue[Array[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,is(fromdigits(vecextract(d,Str("^"i))))&&return(1));0 \\ _Jeppe Stig Nielsen_, Aug 01 2018

%o (Perl) use ntheory ":all"; sub is { my $n=shift; return 0 unless is_prime($n); my @d=todigits($n); return 1 if @d==1; is(fromdigits([vecextract(\@d,~(1<<$_))])) && return 1 for 0..$#d; 0; } # _Dana Jacobsen_, Nov 16 2018

%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(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. A080603, A096235-A096246, A305352.

%K nonn,easy,base

%O 1,1

%A _David W. Wilson_, Feb 25 2003

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | 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 September 19 16:10 EDT 2024. Contains 376013 sequences. (Running on oeis4.)