login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A087395 Primes in which the frequency of every digit is the same and is at least 2. 2

%I #18 Nov 19 2022 20:18:37

%S 11,100313,107071,110909,114343,115757,116969,117373,117979,118787,

%T 119797,121727,127217,127271,131939,133717,133919,134341,136163,

%U 136361,137713,140401,141499,142421,143413,145451,149419,149491,155717,157571

%N Primes in which the frequency of every digit is the same and is at least 2.

%C If d is prime, the only terms with d digits are repunit primes (A004022). - _Robert Israel_, Nov 18 2022

%H Michael S. Branicky, <a href="/A087395/b087395.txt">Table of n, a(n) for n = 1..10000</a>

%H Michael S. Branicky, <a href="/A087395/a087395.py.txt">Python program</a>

%e 100313 is a term in which each of the digits 1, 3 and 0 occurs with frequency 2.

%p filter:= proc(n) local L,d,S;

%p if not isprime(n) then return false fi;

%p L:= convert(n,base,10);

%p S:={seq(numboccur(d,L),d=convert(L,set))};

%p nops(S) = 1 and S[1]>=2

%p end proc:

%p select(filter, [seq(i,i=11 .. 200000, 2)]); # _Robert Israel_, Nov 18 2022

%t 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 *)

%o (Python) # see linked program for a faster version

%o from sympy import isprime

%o from collections import Counter

%o from itertools import count, islice

%o def ok(n):

%o cv = Counter(str(n)).values()

%o return min(cv) >= 2 and len(set(cv)) == 1 and isprime(n)

%o def agen():

%o evdigs = (k for d in count(2, 2) for k in range(10**(d-1)+1, 10**d, 2))

%o yield from (k for k in evdigs if ok(k))

%o print(list(islice(agen(), 30))) # _Michael S. Branicky_, Nov 18 2022

%Y Contains A004022.

%K base,nonn

%O 1,1

%A _Amarnath Murthy_, Sep 10 2003

%E Corrected and extended by _David Wasserman_, May 31 2005

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 19 19:02 EDT 2024. Contains 371798 sequences. (Running on oeis4.)