login
A157146
Prime numbers containing equal number of odd prime digits and even prime digits.
1
23, 127, 239, 251, 263, 271, 283, 293, 521, 823, 827, 1123, 1213, 1217, 1231, 1259, 1279, 1283, 1297, 1321, 1423, 1427, 1627, 1721, 1823, 2003, 2017, 2039, 2063, 2083, 2087, 2113, 2131, 2143, 2179, 2237, 2273, 2309, 2311, 2341, 2381, 2389, 2399, 2417
OFFSET
1,1
COMMENTS
Odd prime digits are 3, 5 or 7 and even prime digit = 2.
The definition also requires that the two digit counts are both larger than zero. [R. J. Mathar, Feb 26 2009]
LINKS
MAPLE
F:= proc(d) uses combinat; local A, m, s2, s2p, s3, CP, T, i, L, v;
A:= NULL;
for m from 1 to d/2 do
for s2 in choose({$2..d}, m) do
s2p:= {$1..d} minus s2;
for s3 in choose(s2p, m) do
CP:= [seq(`if`(member(i, s2), [2], `if`(member(i, s3), [3, 5, 7], [0, 1, 4, 6, 8, 9])), i=1..d)];
T:= cartprod(CP);
while not T[finished] do
L:= T[nextvalue]();
v:= add(L[i]*10^(i-1), i=1..nops(L));
if isprime(v) then A:= A, v fi;
od
od od od;
sort([A]);
end proc:
F(4); # Robert Israel, Jan 27 2019
MATHEMATICA
opepQ[n_]:=Module[{t=DigitCount[n, 10, 2]}, t>0&&Count[IntegerDigits[ n], _?PrimeQ]==2t]; Select[Prime[Range[400]], opepQ] (* Harvey P. Dale, Jun 29 2018 *)
CROSSREFS
Sequence in context: A033211 A142518 A176822 * A232827 A217496 A141963
KEYWORD
nonn,base,less
AUTHOR
EXTENSIONS
Missing numbers inserted by R. J. Mathar, Feb 26 2009
STATUS
approved