OFFSET
1,1
LINKS
Robert Israel, Table of n, a(n) for n = 1..6095
EXAMPLE
a(1) = 104 because 104 is composite and 41 and 401 are prime permutations, and no other permutation of 104 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 >= 3 then return false fi;
fi
od;
evalb(c=2)
end proc:
select(filter, [$10..1000]); # Robert Israel, Jan 22 2017
MATHEMATICA
Select[Range[500], CompositeQ[#]&&Count[FromDigits/@Permutations[ IntegerDigits[ #]], _?PrimeQ]==2&] (* Harvey P. Dale, Aug 10 2017 *)
CROSSREFS
KEYWORD
easy,nonn,base
AUTHOR
Gil Broussard, Jul 30 2009
STATUS
approved