|
|
A235154
|
|
Primes which have one or more occurrences of exactly two different digits.
|
|
22
|
|
|
13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97, 101, 113, 131, 151, 181, 191, 199, 211, 223, 227, 229, 233, 277, 311, 313, 331, 337, 353, 373, 383, 433, 443, 449, 499, 557, 577, 599, 661, 677, 727, 733, 757, 773, 787, 797, 811
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
1,1
|
|
COMMENTS
|
The first term having a repeated digit is 101.
a(3402) > 10^10.
|
|
LINKS
|
|
|
PROG
|
(PARI) s=[]; forprime(n=10, 1000, if(#vecsort(eval(Vec(Str(n))), , 8)==2, s=concat(s, n))); s
(PARI) \\ See Corneth link
(Python)
from sympy import isprime
from sympy.utilities.iterables import multiset_permutations
from itertools import count, islice, combinations_with_replacement, product
def agen():
for digits in count(2):
s = set()
for pair in product("0123456789", "1379"):
if pair[0] == pair[1]: continue
for c in combinations_with_replacement(pair, digits):
if len(set(c)) < 2 or sum(int(ci) for ci in c)%3 == 0:
continue
for p in multiset_permutations(c):
if p[0] == "0": continue
t = int("".join(p))
if isprime(t):
s.add(t)
yield from sorted(s)
|
|
CROSSREFS
|
|
|
KEYWORD
|
nonn,base
|
|
AUTHOR
|
|
|
STATUS
|
approved
|
|
|
|