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.

A080608 Deletable primes: primes such that removing some digit leaves either the empty string or another deletable prime (possibly preceded by some zeros).

Original entry on oeis.org

2, 3, 5, 7, 13, 17, 23, 29, 31, 37, 43, 47, 53, 59, 67, 71, 73, 79, 83, 97, 103, 107, 113, 127, 131, 137, 139, 157, 163, 167, 173, 179, 193, 197, 223, 229, 233, 239, 263, 269, 271, 283, 293, 307, 311, 313, 317, 331, 337, 347, 353, 359, 367, 373, 379, 383, 397, 431, 433, 439
Offset: 1

Views

Author

David W. Wilson, Feb 25 2003

Keywords

Comments

Subsequence of A179336. - Reinhard Zumkeller, Jul 11 2010
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
For a version that does not allow leading zeros, see A305352. - Jeppe Stig Nielsen, Aug 01 2018

Examples

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

Crossrefs

Programs

  • Maple
    read("transforms"):
    isA080608 := proc(n)
        option remember;
        local dgs,i ;
        if isprime(n) then
            if n < 10 then
                true;
            else
                dgs := convert(n,base,10) ;
                for i from 1 to nops(dgs) do
                    subsop(i=NULL,dgs) ;
                    digcatL(ListTools[Reverse](%)) ;
                    if procname(%)  then
                        return true;
                    end if;
                end do:
                false ;
            end if;
        else
            false;
        end if;
    end proc:
    n := 1;
    for i from 1 to 500 do
        p := ithprime(i) ;
        if isA080608(p) then
            printf("%d %d\n",n,p) ;
            n := n+1 ;
        fi ;
    end do: # R. J. Mathar, Oct 11 2014
  • Mathematica
    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 *)
  • 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
    
  • 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
    
  • Python
    from sympy import isprime
    def ok(n):
        if not isprime(n): return False
        if n < 10: return True
        s = str(n)
        si = (s[:i]+s[i+1:] for i in range(len(s)))
        return any(ok(int(t)) for t in si)
    print([k for k in range(440) if ok(k)]) # Michael S. Branicky, Jan 28 2023