|
|
A163556
|
|
Composite numbers such that exactly four distinct permutations of decimal digits are prime.
|
|
3
|
|
|
170, 194, 710, 790, 791, 793, 914, 917, 970, 973, 1003, 1012, 1015, 1016, 1024, 1028, 1030, 1042, 1082, 1090, 1102, 1105, 1106, 1120, 1126, 1135, 1138, 1150, 1157, 1159, 1160, 1162, 1175, 1178, 1183, 1195, 1204, 1208, 1210, 1216, 1234, 1240, 1243, 1258
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
1,1
|
|
LINKS
|
|
|
EXAMPLE
|
a(1) = 170 because 170 is composite, the four permutations 17, 71, 107, and 701 are all prime, and no other permutation of 170 is prime.
|
|
MAPLE
|
filter:= proc(n) local d, Permutor, P, c, i;
if isprime(n) then return false fi;
d:= ilog10(n)+1;
Permutor:= Iterator:-Permute(convert(n, base, 10));
c:= 0;
for P in Permutor do
if isprime(add(P[i]*10^(i-1), i=1..d)) then
c:= c+1;
if c >= 5 then return false fi;
fi
od;
evalb(c=4)
end proc:
|
|
MATHEMATICA
|
Select[Range[1300], CompositeQ[#]&&Count[FromDigits/@Permutations[ IntegerDigits[ #]], _?PrimeQ]==4&] (* Harvey P. Dale, Oct 26 2015 *)
|
|
CROSSREFS
|
|
|
KEYWORD
|
easy,nonn,base
|
|
AUTHOR
|
|
|
STATUS
|
approved
|
|
|
|