login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A163555
Composite numbers such that exactly three distinct permutations of digits give primes.
3
130, 136, 175, 176, 301, 310, 316, 361, 370, 371, 395, 398, 517, 539, 671, 703, 713, 715, 716, 730, 731, 893, 935, 938, 1004, 1025, 1027, 1034, 1040, 1043, 1052, 1058, 1072, 1085, 1118, 1124, 1142, 1147, 1169, 1174, 1189, 1196, 1198, 1205, 1207, 1214
OFFSET
1,1
LINKS
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 *)
KEYWORD
easy,nonn,base
AUTHOR
Gil Broussard, Jul 30 2009
STATUS
approved