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.

A386004 Primes whose digit set intersects the odd digits in at most one element and intersects the even digits in at most two elements.

Original entry on oeis.org

2, 3, 5, 7, 11, 23, 29, 41, 43, 47, 61, 67, 83, 89, 101, 181, 211, 223, 227, 229, 233, 241, 263, 269, 277, 281, 283, 383, 401, 409, 421, 433, 443, 449, 461, 463, 467, 487, 499, 601, 607, 641, 643, 647, 661, 677, 683, 727, 787, 809, 811, 821, 823, 827, 829, 863
Offset: 1

Views

Author

Jean-Marc Rebert, Jul 14 2025

Keywords

Comments

From David A. Corneth, Jul 14 2025: (Start)
Terms can have at most three distinct digits.
Terms > 5 cannot have a digit 5. Proof: Terms > 5 are odd as they are prime. They cannot have a last digit 5. So if they have a digit 5 then they have at least two distinct odd digits contradicting the sequence definition of having at most one odd digit. (End)

Examples

			101 is a term because it is prime and its digit set is {0, 1} — containing at most one odd digit and no more than two distinct even digits.
1021 is a term because it is prime and its digit set is {0,1,2} — containing at most one odd digit and no more than two distinct even digits.
		

Crossrefs

Programs

  • Mathematica
    Select[Prime[Range[150]],Length[Intersection[d=IntegerDigits[#],{1,3,5,7,9}]]<=1 && Length[Intersection[d,{0,2,4,6,8}]]<=2 &] (* Stefano Spezia, Jul 14 2025 *)
  • PARI
    is(n) = if(!isprime(n), return(0)); my(s=Set(digits(n)), odd=0); if(#s>3,return(0)); odd=sum(i=1, #s ,bitand(s[i], 1)); if(odd > 1, return(0)); if(#s-odd > 2, return(0)); 1 \\ David A. Corneth, Jul 14 2025