A276461 Prime numbers whose digits are k+1 1's and k 2's for some k >= 1.
211, 12211, 21121, 21211, 22111, 1121221, 1212121, 2121121, 2211211, 2221111, 111221221, 112212211, 112221211, 121211221, 211122211, 211212121, 211222111, 221112121, 221212111, 11122121221, 11122221211, 11211221221, 11212211221, 11212221121, 11222112211
Offset: 1
Programs
-
Mathematica
Table[Select[Map[FromDigits, Permutations[ConstantArray[1, n + 1] ~Join~ ConstantArray[2, n], {2 n + 1}]], PrimeQ], {n, 5}] // Flatten (* Michael De Vlieger, Sep 04 2016 *)
-
PARI
listp(nn) = { forprime(p=2, nn, d = digits(p); if ((vecmin(d) == 1) && (vecmax(d) == 2) && (#select(x->x==1, d) == #select(x->x==2, d) +1), print1(p, ", ");););} \\ Michel Marcus, Sep 04 2016
Comments