login
A034895
Dropping any digit gives a prime number.
9
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,1
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
LINKS
Robert G. Wilson v, Table of n, a(n) for n = 1..752 (first 485 terms from T. D. Noe)
EXAMPLE
1379 is in the sequence since 379, 179, 139 & 137 are all primes. - Robert G. Wilson v, Oct 07 2014
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 *)
PROG
(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<b, return(0));
while(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
CROSSREFS
Cf. A267413.
Sequence in context: A296763 A236404 A058814 * A106582 A092619 A092624
KEYWORD
nonn,base,nice
STATUS
approved