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.
%I A216165 #16 Sep 08 2022 08:46:03 %S A216165 1,49,63,81,91,99,117,123,213,231,279,319,427,459,621,697,721,801,951, %T A216165 987,1113,1131,1261,1821,1939,2101,2149,2211,2517,2611,3151,3219,4011, %U A216165 4411,4887,5031,5361,6231,6487,7011,7209,8671,9141,9801,10051,10161,10281 %N A216165 Composite numbers and 1 which yield a prime whenever a 1 is inserted anywhere in them, including at the beginning or end. %H A216165 Paolo P. Lava, <a href="/A216165/b216165.txt">Table of n, a(n) for n = 1..250</a> %e A216165 7209 is not prime but 72091, 72019, 72109, 71209 and 17209 are all primes. %p A216165 with(numtheory); %p A216165 A216165:=proc(q,x) %p A216165 local a,b,c,i,n,ok; %p A216165 for n from 1 to q do %p A216165 if not isprime(n) then %p A216165 a:=n; b:=0; while a>0 do b:=b+1; a:=trunc(a/10); od; a:=n; ok:=1; %p A216165 for i from 0 to b do c:=a+9*10^i*trunc(a/10^i)+10^i*x; %p A216165 if not isprime(c) then ok:=0; break; fi; %p A216165 od; %p A216165 if ok=1 then print(n); fi; %p A216165 fi; %p A216165 od; end: %p A216165 A216165(1000,1); %t A216165 Join[{1},Select[Range[11000],CompositeQ[#]&&AllTrue[FromDigits/@ Table[ Insert[ IntegerDigits[#],1,i],{i,IntegerLength[#]+1}],PrimeQ]&]] (* _Harvey P. Dale_, Mar 24 2017 *) (* The program uses the AllTrue function from Mathematica version 10 *) (* _Harvey P. Dale_, Mar 24 2017 *) %o A216165 (Magma) [n: n in [1..11000] | not IsPrime(n) and forall{m: t in [0..#Intseq(n)] | IsPrime(m) where m is (Floor(n/10^t)*10+1)*10^t+n mod 10^t}]; // _Bruno Berselli_, Sep 03 2012 %Y A216165 Cf. A068673, A068674, A068677, A068679, A069246, A215417, A215419-A215421, A216166-A216169. %K A216165 nonn,base %O A216165 1,2 %A A216165 _Paolo P. Lava_, Sep 03 2012