login
Primes consisting of exactly three 3's, five 5's and seven 7's.
1

%I #9 Apr 08 2024 18:56:34

%S 333555577577777,333555577777577,333555757775777,333555775757777,

%T 333555775777577,333557555777777,333557575777757,333557757577757,

%U 333557757755777,333557775777557,333557777555777,333557777557757,333557777575577,333575577577757,333575577757757,333575577775577,333575755777577

%N Primes consisting of exactly three 3's, five 5's and seven 7's.

%C The last term is a(29943) = 777777735555533.

%H Robert Israel, <a href="/A371834/b371834.txt">Table of n, a(n) for n = 1..29943</a>

%e a(3) = 333555757775777 is a term because its 15 digits consist of three 3's, five 5's and seven 7's.

%p select(isprime, map(t -> add(t[i]*10^(15-i),i=1..15), combinat:-permute([3$3,5$5,7$7])));

%o (Python)

%o from sympy import isprime

%o from sympy.utilities.iterables import multiset_permutations

%o def agen(): # generator of terms

%o for mp in multiset_permutations("333555557777777"):

%o if mp[-1] != "5":

%o t = int("".join(mp))

%o if isprime(t):

%o yield t

%o afull = [p for p in agen()] # _Michael S. Branicky_, Apr 07 2024

%K nonn,base,fini,full

%O 1,1

%A _Zak Seidov_ and _Robert Israel_, Apr 07 2024