login
Primes that contain digits 6 and 7 only.
8

%I #15 Nov 15 2022 10:46:54

%S 7,67,677,67777,76667,76777,666667,677767,767677,777677,6676667,

%T 6676777,6677677,6677767,6677777,6766667,6766777,6776677,7666667,

%U 7667677,7667767,7766767,7766777,7777667,66666667,66677777,66776777,67667777,67766767,67776677,67776767

%N Primes that contain digits 6 and 7 only.

%H Michael S. Branicky, <a href="/A020469/b020469.txt">Table of n, a(n) for n = 1..10000</a> (terms 1..1000 from Vincenzo Librandi)

%t Flatten[Table[Select[FromDigits/@Tuples[{6,7},n],PrimeQ],{n,8}]] (* _Vincenzo Librandi_, Jul 27 2012 *)

%o (Python)

%o from sympy import isprime

%o from itertools import count, islice, product

%o def agen(): # generator of terms

%o yield 7

%o for d in count(2):

%o for first in product("67", repeat=d-1):

%o t = int("".join(first) + "7")

%o if isprime(t): yield t

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

%Y Cf. A020449-A020472.

%K nonn,base

%O 1,1

%A _David W. Wilson_