OFFSET
1,1
COMMENTS
Primes whose decimal representation contains the same number of i's as (i+1)'s for i = 0, 2, 4, 6 and 8.
All terms have an even number of digits.
LINKS
Robert Israel, Table of n, a(n) for n = 1..10000
EXAMPLE
a(4) = 1607 is a term because 1607 is prime and has the same number (1) of 0's and 1's, the same number (1) of 6's and 7's, and the same number (0) of all other digits.
MAPLE
filter:= proc(n) local L; L:= convert(n, base, 10);
andmap(i -> numboccur(i, L) = numboccur(i+1, L), [0, 2, 4, 6, 8]) and isprime(n)
end proc:
select(filter, [seq(seq(x, x=10^(d-1)+1 .. 10^d-1, 2), d=2..6, 2)]);
MATHEMATICA
pQ[p_]:= AllTrue[{0, 2, 4, 6, 8}, Count[IntegerDigits[p], #]==Count[IntegerDigits[p], #+1]&]; Select[Prime[Range[10363]], pQ] (* James C. McMahon, Mar 30 2026 *)
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Robert Israel, Mar 26 2026
STATUS
approved
