login
A163557
Composite numbers such that exactly five distinct permutations of digits give primes.
4
1007, 1018, 1057, 1067, 1070, 1075, 1076, 1081, 1108, 1127, 1172, 1180, 1271, 1298, 1330, 1336, 1337, 1339, 1363, 1369, 1393, 1396, 1468, 1486, 1507, 1570, 1576, 1633, 1639, 1648, 1670, 1675, 1684, 1696, 1700, 1705, 1706, 1712, 1750, 1756, 1760, 1765
OFFSET
1,1
LINKS
EXAMPLE
a(1) = 1007 because 1007 is composite, the five permutations 17, 71, 107, 701, and 7001 are all prime, and no other permutation of 1007 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 >= 6 then return false fi;
fi
od;
evalb(c=5)
end proc:
select(filter, [$10..2000]); # Robert Israel, Dec 30 2025
PROG
(PARI) upto(m)= my(r=List()); forcomposite(n=1, m, my(d=vecsort(digits(n)), c=0); forperm(d, p, (c+=isprime(fromdigits(p)))>5 && break); 5==c && listput(r, n)); Vec(r); \\ Ruud H.G. van Tol, Jan 02 2026
CROSSREFS
Sequence in context: A202147 A252417 A067918 * A241932 A160451 A254973
KEYWORD
easy,nonn,base
AUTHOR
Gil Broussard, Jul 30 2009
EXTENSIONS
Checked by Zak Seidov, Jul 01 2009
STATUS
approved