OFFSET
1,1
LINKS
Robert Israel, Table of n, a(n) for n = 1..10000
EXAMPLE
a(1) = 130 because 130 is composite and 13, 31, and 103 are prime permutations, and no other permutation of 130 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 >= 4 then return false fi;
fi
od;
evalb(c=3)
end proc:
select(filter, [$100..2000]); # Robert Israel, Aug 10 2020
MATHEMATICA
With[{no=1400}, Select[Complement[Range[no], Prime[Range[PrimePi[no]]]], Count[FromDigits/@Permutations[IntegerDigits[#]], _?PrimeQ]==3&]] (* Harvey P. Dale, Feb 25 2011 *)
CROSSREFS
KEYWORD
easy,nonn,base
AUTHOR
Gil Broussard, Jul 30 2009
STATUS
approved