login
Primes that contain digits 7 and 9 only.
12

%I #14 Sep 08 2022 08:44:45

%S 7,79,97,797,977,997,77797,77977,77999,79777,79979,79997,79999,97777,

%T 777977,777979,779797,797977,799979,799999,999979,7777997,7779979,

%U 7779997,7797799,7797997,7799797,7799999,7977779,7977797,7977799,7977997

%N Primes that contain digits 7 and 9 only.

%H Vincenzo Librandi, <a href="/A020471/b020471.txt">Table of n, a(n) for n = 1..1000</a>

%H <a href="/index/Pri#PrimesWithDigits">Index to entries about primes with digits in a given set</a>

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

%o (Magma) [p: p in PrimesUpTo(7977997) | Set(Intseq(p)) subset [7,9]]; // _Vincenzo Librandi_, Jul 28 2012

%Y Cf. A020449 (digits 0 & 1), ..., A020472 (digits 8 & 9).

%K nonn,base

%O 1,1

%A _David W. Wilson_

%E Edited by _M. F. Hasler_, Jul 26 2015