login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

Composites that become prime when any two of their digits are deleted.
0

%I #12 Dec 03 2024 12:48:52

%S 222,225,232,235,237,252,253,255,272,273,275,322,323,325,327,332,333,

%T 335,352,355,357,372,375,377,522,525,527,532,533,535,537,552,553,555,

%U 572,573,575,722,723,725,732,735,737,752,753,755,772,775,777,1111,1113,1119,1131,1137,1173,1179,1197,1311,1317,1371

%N Composites that become prime when any two of their digits are deleted.

%C Any term < 1000 has exactly three digits and all digits are prime (cf. A061371).

%C The repunits (cf. A002275) R_21, R_25, R_319, R_1033 and R_49083, among others, are in the sequence since R_19, R_23, R_317, R_1031 and R_49081 are prime (cf. A004023).

%C The corresponding sequence for primes (cf. A378081) contains only 18 terms up to 10^100.

%e 1371 is in the sequence since upon deleting any two digits we get 13, 71, 17, 31, 11 and 37, all of which are prime.

%e 1313 is not in the sequence since upon deleting the two 1s we get 33, which is not prime.

%t q[n_] := Module[{d = IntegerDigits[n]}, AllTrue[FromDigits /@ Subsets[d, {Length[d] - 2}], PrimeQ]]; Select[Range[100, 1500], CompositeQ[#] && q[#] &] (* _Amiram Eldar_, Nov 26 2024 *)

%o (Python)

%o from sympy import isprime

%o from itertools import combinations as C

%o def ok(n):

%o if n < 100 or isprime(n): return False

%o s = str(n)

%o return all(isprime(int(t)) for i, j in C(range(len(s)), 2) if (t:=s[:i]+s[i+1:j]+s[j+1:])!="")

%o print([k for k in range(1500) if ok(k)]) # _Michael S. Branicky_, Nov 26 2024

%Y Cf. A002808, A002275, A004023, A061371, A378081.

%K nonn,base

%O 1,1

%A _Enrique Navarrete_, Nov 26 2024