login
Prime numbers that will become composite after removing any group of initial digits.
1

%I #33 Jun 05 2024 18:30:54

%S 19,29,59,79,89,109,139,149,199,239,269,349,409,439,449,499,509,569,

%T 599,709,739,769,809,839,1009,1039,1049,1069,1249,1399,1549,1609,1669,

%U 1699,1949,1999,2039,2069,2099,2309,2339,2399,2539,2549,2609,2699,2749,2909

%N Prime numbers that will become composite after removing any group of initial digits.

%H Alois P. Heinz, <a href="/A242550/b242550.txt">Table of n, a(n) for n = 1..1000</a>

%e 127 is not a term because 7 is prime.

%e 139 is a term because 139 is prime but 39 and 9 are composite.

%t crgidQ[p_]:=AllTrue[FromDigits/@Table[Drop[IntegerDigits[p],k],{k,IntegerLength[ p]-1}],CompositeQ]; Select[Prime[Range[5,500]],crgidQ] (* _Harvey P. Dale_, Jun 05 2024 *)

%o (PARI) arecomp(p) = {nbd = #digits(p); for (i=1, nbd-1, if (isprime(q=(p % 10^i)) || (q==1), return(0));); return (1);}

%o isokp(p) = (p>10) && isprime(p) && arecomp(p); \\ _Michel Marcus_, May 17 2014

%Y Cf. A242265.

%Y Subsequence of A030433 and A242265.

%K nonn,base

%O 1,1

%A _J. Lowell_, May 17 2014

%E More terms from _Michel Marcus_, May 17 2014