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.

A323578 Primes with distinct digits for which parity of digits alternates.

Original entry on oeis.org

2, 3, 5, 7, 23, 29, 41, 43, 47, 61, 67, 83, 89, 103, 107, 109, 127, 149, 163, 167, 307, 347, 349, 367, 389, 503, 509, 521, 523, 541, 547, 563, 569, 587, 701, 709, 743, 761, 769, 907, 941, 947, 967, 983, 2143, 2309
Offset: 1

Views

Author

Bernard Schott, Jan 18 2019

Keywords

Comments

There are 4426 terms (found by David A. Corneth) in this sequence, which is a subsequence of A030144.
The largest prime of this sequence is 987654103 which is also the largest prime with distinct digits in A029743.

Examples

			2143 is a term as 2, 1, 4 and 3 have even and odd parity alternately and these four digits are all distinct.
		

Crossrefs

Intersection of A030144 and A029743.

Programs

  • Mathematica
    {2}~Join~Select[Prime@ Range@ 350, And[Max@ Tally[#][[All, -1]] == 1, AllTrue[#[[Range[2, Length[#], 2] ]], EvenQ], AllTrue[#[[Range[1, Length[#], 2] ]], OddQ]] &@ Reverse@ IntegerDigits@ # &] (* Michael De Vlieger, Jan 19 2019 *)
  • PARI
    allTerms() = {my(res = List([2])); c = vector(10); odd = [1, 3, 5, 7, 9]; even = [0, 2, 4, 6, 8]; for(i = 0, 119, pi = numtoperm(5, i); vi = vector(5, k, odd[pi[k]]); for(j = 0, 119, pj = numtoperm(5, j); vj = vector(5, k, even[pj[k]]); for(m = 1, 5, c[2*m] = vi[m]; c[2*m - 1] = vj[m]; ); cv = fromdigits(c); for(m = 1, 10, if(isprime(cv % 10^m), listput(res, cv % 10^m); ) ) ) ); listsort(res, 1); res } \\ David A. Corneth, Jan 18 2019