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.

Original entry on oeis.org

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

Views

Author

Enrique Navarrete, Sep 25 2024

Keywords

Comments

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.
The primes in the sequence cannot contain 5.
No further terms up to 10^10. - Robert Israel, Sep 25 2024

Examples

			1249 is in the sequence since the permutations described in the name produce 9241, 1429 and 9421, which are also prime.
		

Crossrefs

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