A087395 Primes in which the frequency of every digit is the same and is at least 2.
11, 100313, 107071, 110909, 114343, 115757, 116969, 117373, 117979, 118787, 119797, 121727, 127217, 127271, 131939, 133717, 133919, 134341, 136163, 136361, 137713, 140401, 141499, 142421, 143413, 145451, 149419, 149491, 155717, 157571
Offset: 1
Examples
100313 is a term in which each of the digits 1, 3 and 0 occurs with frequency 2.
Links
- Michael S. Branicky, Table of n, a(n) for n = 1..10000
- Michael S. Branicky, Python program
Crossrefs
Contains A004022.
Programs
-
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 *)
-
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
Extensions
Corrected and extended by David Wasserman, May 31 2005
Comments