|
|
A154390
|
|
Composites whose largest digit is prime.
|
|
2
|
|
|
12, 15, 20, 21, 22, 25, 27, 30, 32, 33, 35, 45, 50, 51, 52, 54, 55, 57, 70, 72, 74, 75, 76, 77, 102, 105, 112, 115, 117, 120, 121, 122, 123, 125, 130, 132, 133, 135, 145, 147, 150, 152, 153, 154, 155, 170, 171, 172, 174, 175, 176, 177, 200, 201, 202, 203, 205, 207
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
1,1
|
|
LINKS
|
|
|
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)
|
|
CROSSREFS
|
|
|
KEYWORD
|
nonn,base
|
|
AUTHOR
|
|
|
EXTENSIONS
|
|
|
STATUS
|
approved
|
|
|
|