login

Reminder: The OEIS is hiring a new managing editor, and the application deadline is January 26.

Primes that contain only the digits (2, 7, 9).
2

%I #11 Dec 17 2024 19:30:39

%S 2,7,29,79,97,227,229,277,727,797,929,977,997,2297,2729,2777,2797,

%T 2927,2999,7229,7297,7727,7927,9227,9277,9929,22229,22277,22279,22727,

%U 22777,27277,27299,27779,27799,27997,29297,29927,72227,72229,72277,72727,72797

%N Primes that contain only the digits (2, 7, 9).

%C A020459, A020460 and A020471 are subsequences.

%H Chai Wah Wu, <a href="/A261182/b261182.txt">Table of n, a(n) for n = 1..1000</a>

%t Select[Prime[Range[2 10^4]], Complement[IntegerDigits[#], {2, 7, 9}] == {} &]

%t Select[Flatten[Table[FromDigits/@Tuples[{2,7,9},n],{n,5}]],PrimeQ] (* _Harvey P. Dale_, Dec 17 2024 *)

%o (Magma) [p: p in PrimesUpTo(2*10^5) | Set(Intseq(p)) subset [2, 7, 9]];

%o (Python)

%o from gmpy2 import is_prime

%o from itertools import product

%o A261182_list = [int(''.join(d)) for l in range(1,10) for d in product('279',repeat=l) if is_prime(int(''.join(d)))] # _Chai Wah Wu_, Aug 11 2015

%Y Cf. similar sequences listed in A261181.

%Y Cf. A000040, A020459, A020460, A020471.

%K nonn,easy,base

%O 1,1

%A _Vincenzo Librandi_, Aug 11 2015