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.

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