OFFSET
1,1
LINKS
G. C. Greubel, Table of n, a(n) for n = 1..1000
EXAMPLE
12 is a term because it is composite and its largest digit (2) is prime.
15 is a term because it is composite and its largest digit (5) is prime.
20 is a term because it is composite and its largest digit (2) is prime.
MAPLE
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
MATHEMATICA
Select[Range[250], !PrimeQ[#]&&PrimeQ[Max[IntegerDigits[#]]]&] (* Harvey P. Dale, Dec 20 2012 *)
PROG
(GAP) A:=Filtered([2..210], n->not IsPrime(n));;
B:=List(List(List(List(A, ListOfDigits), Reversed), Set), Reversed);;
a:=List(Filtered([1..Length(B)], i->IsPrime(B[i][1])), i->A[i]); # Muniru A Asiru, Feb 10 2019
(Python)
from sympy import isprime
def ok(n): return max(str(n)) in "2357" and not isprime(n)
print([k for k in range(208) if ok(k)]) # Michael S. Branicky, Dec 15 2021
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Juri-Stepan Gerasimov, Jan 08 2009
EXTENSIONS
Corrected by Juri-Stepan Gerasimov, Jan 28 2009
Corrected (added 21) and extended by Emeric Deutsch, Jan 27 2009
STATUS
approved