OFFSET
1,1
LINKS
Robert Israel, Table of n, a(n) for n = 1..10000
EXAMPLE
a(1) = 1036 because 1036 is composite, the six permutations 163, 613, 631, 1063, 3061, and 6301 are all prime, and no other permutation of 1036 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 >= 7 then return false fi;
fi
od;
evalb(c=6)
end proc:
select(filter, [$10..2000]); # Robert Israel, Dec 30 2025
MATHEMATICA
Select[Range[2000], CompositeQ[#]&&Count[FromDigits/@Permutations[ IntegerDigits[ #]], _?PrimeQ]==6&] (* Harvey P. Dale, Mar 05 2023 *)
CROSSREFS
KEYWORD
easy,nonn,base
AUTHOR
Gil Broussard, Jul 30 2009
STATUS
approved
