cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

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.

This page as a plain text file.
%I A376502 #15 Oct 21 2024 14:29:18
%S A376502 1249,1429,1487,1847,2617,2671,4019,4091,6217,6271,6389,6709,6907,
%T A376502 6983,7481,7841,8369,8963,9241,9421,60337,60373,60733
%N 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.
%C A376502 Primes for which permutations described in the name produce primes with leading 0s are in the sequence but the generated primes with leading 0s are not. For example, in 6709: permutations of odd digits produce 6907, permutations of even digits  produce 769, and permutations of even digits and of odd digits produce 967.  Hence 6709 and 6907 are in the sequence but 769 and 967 are not since they have leading 0s.
%C A376502 The primes in the sequence cannot contain 5.
%C A376502 No further terms up to 10^10. - _Robert Israel_, Sep 25 2024
%e A376502 1249 is in the sequence since the permutations described in the name produce 9241, 1429 and 9421, which are also prime.
%p A376502 filter:= proc(n) local L,Ev,Od,Le,Lo,i,x;
%p A376502   if not isprime(n) then return false fi;
%p A376502   L:= convert(n,base,10);
%p A376502   Ev,Od:= selectremove(t -> L[t]::even,[$1..nops(L)]);
%p A376502   if nops(convert(L[Ev],set)) < 2 or nops(convert(L[Od],set)) < 2 then return false fi;
%p A376502   for Le in combinat:-permute(L[Ev]) do
%p A376502     for Lo in combinat:-permute(L[Od]) do
%p A376502       x:= add(Le[i]*10^(Ev[i]-1),i=1..nops(Ev)) + add(Lo[i]*10^(Od[i]-1),i=1..nops(Od));
%p A376502       if not isprime(x) then return false fi
%p A376502   od od;
%p A376502   true
%p A376502 end proc:
%p A376502 select(filter, [$1000 .. 10^5]); # _Robert Israel_, Sep 25 2024
%Y A376502 Cf. A000040, A003459, A376500, A376501.
%K A376502 nonn,more,base
%O A376502 1,1
%A A376502 _Enrique Navarrete_, Sep 25 2024
%E A376502 a(21) to a(23) from _Robert Israel_, Sep 25 2024