OFFSET
1,1
COMMENTS
If d is prime, the only terms with d digits are repunit primes (A004022). - Robert Israel, Nov 18 2022
LINKS
Michael S. Branicky, Table of n, a(n) for n = 1..10000
Michael S. Branicky, Python program
EXAMPLE
100313 is a term in which each of the digits 1, 3 and 0 occurs with frequency 2.
MAPLE
filter:= proc(n) local L, d, S;
if not isprime(n) then return false fi;
L:= convert(n, base, 10);
S:={seq(numboccur(d, L), d=convert(L, set))};
nops(S) = 1 and S[1]>=2
end proc:
select(filter, [seq(i, i=11 .. 200000, 2)]); # Robert Israel, Nov 18 2022
MATHEMATICA
fpQ[n_]:=Module[{dc=Union[Cases[DigitCount[n], Except[0]]]}, First[dc]>1 &&Length[dc]==1]; Select[Prime[Range[14500]], fpQ] (* Harvey P. Dale, Apr 22 2011 *)
PROG
(Python) # see linked program for a faster version
from sympy import isprime
from collections import Counter
from itertools import count, islice
def ok(n):
cv = Counter(str(n)).values()
return min(cv) >= 2 and len(set(cv)) == 1 and isprime(n)
def agen():
evdigs = (k for d in count(2, 2) for k in range(10**(d-1)+1, 10**d, 2))
yield from (k for k in evdigs if ok(k))
print(list(islice(agen(), 30))) # Michael S. Branicky, Nov 18 2022
CROSSREFS
KEYWORD
base,nonn
AUTHOR
Amarnath Murthy, Sep 10 2003
EXTENSIONS
Corrected and extended by David Wasserman, May 31 2005
STATUS
approved