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”).
%I #22 Dec 15 2021 07:49:30
%S 12,15,20,21,22,25,27,30,32,33,35,45,50,51,52,54,55,57,70,72,74,75,76,
%T 77,102,105,112,115,117,120,121,122,123,125,130,132,133,135,145,147,
%U 150,152,153,154,155,170,171,172,174,175,176,177,200,201,202,203,205,207
%N Composites whose largest digit is prime.
%H G. C. Greubel, <a href="/A154390/b154390.txt">Table of n, a(n) for n = 1..1000</a>
%e 12 is a term because it is composite and its largest digit (2) is prime.
%e 15 is a term because it is composite and its largest digit (5) is prime.
%e 20 is a term because it is composite and its largest digit (2) is prime.
%p a := proc (n) local nn; nn := convert(n, base, 10): if isprime(n) = false and isprime(max(seq(nn[i], i = 1 .. nops(nn)))) = true then n else end if end proc: seq(a(n), n = 1 .. 220); # _Emeric Deutsch_, Jan 27 2009
%t Select[Range[250],!PrimeQ[#]&&PrimeQ[Max[IntegerDigits[#]]]&] (* _Harvey P. Dale_, Dec 20 2012 *)
%o (GAP) A:=Filtered([2..210],n->not IsPrime(n));;
%o B:=List(List(List(List(A,ListOfDigits),Reversed),Set),Reversed);;
%o a:=List(Filtered([1..Length(B)],i->IsPrime(B[i][1])),i->A[i]); # _Muniru A Asiru_, Feb 10 2019
%o (Python)
%o from sympy import isprime
%o def ok(n): return max(str(n)) in "2357" and not isprime(n)
%o print([k for k in range(208) if ok(k)]) # _Michael S. Branicky_, Dec 15 2021
%Y Subsequence of A117815.
%Y Cf. A000040, A002808, A054055, A155777.
%K nonn,base
%O 1,1
%A _Juri-Stepan Gerasimov_, Jan 08 2009
%E Corrected by _Juri-Stepan Gerasimov_, Jan 28 2009
%E Corrected (added 21) and extended by _Emeric Deutsch_, Jan 27 2009