A376502 Primes that contain at least two different even digits and at least two different odd digits where any permutation of the odd digits and any permutation of the even digits produces a prime. See comments for the treatment of 0s.
1249, 1429, 1487, 1847, 2617, 2671, 4019, 4091, 6217, 6271, 6389, 6709, 6907, 6983, 7481, 7841, 8369, 8963, 9241, 9421, 60337, 60373, 60733
Offset: 1
Examples
1249 is in the sequence since the permutations described in the name produce 9241, 1429 and 9421, which are also prime.
Programs
-
Maple
filter:= proc(n) local L,Ev,Od,Le,Lo,i,x; if not isprime(n) then return false fi; L:= convert(n,base,10); Ev,Od:= selectremove(t -> L[t]::even,[$1..nops(L)]); if nops(convert(L[Ev],set)) < 2 or nops(convert(L[Od],set)) < 2 then return false fi; for Le in combinat:-permute(L[Ev]) do for Lo in combinat:-permute(L[Od]) do x:= add(Le[i]*10^(Ev[i]-1),i=1..nops(Ev)) + add(Lo[i]*10^(Od[i]-1),i=1..nops(Od)); if not isprime(x) then return false fi od od; true end proc: select(filter, [$1000 .. 10^5]); # Robert Israel, Sep 25 2024
Extensions
a(21) to a(23) from Robert Israel, Sep 25 2024
Comments