cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A385776 Primes having only {1, 2, 9} as digits.

This page as a plain text file.
%I A385776 #34 Jul 12 2025 21:23:16
%S A385776 2,11,19,29,191,199,211,229,911,919,929,991,1129,1229,1291,1999,2111,
%T A385776 2129,2221,2999,9199,9221,9929,11119,11299,12119,12211,12911,12919,
%U A385776 19121,19211,19219,19919,19991,21121,21191,21211,21221,21911,21929,21991
%N A385776 Primes having only {1, 2, 9} as digits.
%H A385776 Jason Bard, <a href="/A385776/b385776.txt">Table of n, a(n) for n = 1..10000</a>
%H A385776 <a href="/index/Pri#PrimesWithDigits">Index to entries for primes with digits in a given set</a>
%t A385776 Flatten[Table[Select[FromDigits /@ Tuples[{1, 2, 9}, n], PrimeQ], {n, 7}]]
%o A385776 (Magma) [p: p in PrimesUpTo(10^6) | Set(Intseq(p)) subset [1, 2, 9]];
%o A385776 (PARI) primes_with(n=50, show=0, L=[1, 2, 9])={for(d=1, 1e9, my(t, u=vector(d, i, 10^(d-i))~); forvec(v=vector(d, i, [1+!(L[1]||(i>1&&i<d)), #L]), ispseudoprime(t=vecextract(L, v)*u)||next; show&&print1(t", "); n--||return(t)))};
%o A385776 primes_with(,1,[1,2,9])
%o A385776 (Python)
%o A385776 from gmpy2 import is_prime
%o A385776 from itertools import count, islice, product
%o A385776 def primes_with(digits):  # generator of primes having only set(digits) as digits
%o A385776     S, E = "".join(sorted(set(digits) - {'0'})), "".join(sorted(set(digits) & set("1379")))
%o A385776     yield from (p for p in [2, 3, 5, 7] if str(p) in digits)
%o A385776     yield from (t for d in count(2) for s in S for m in product(digits, repeat=d-2) for e in E if is_prime(t:=int(s+"".join(m)+e)))
%o A385776 print(list(islice(primes_with("129"), 41))) # _Michael S. Branicky_, Jul 11 2025
%Y A385776 Supersequence of A020450, A020457, A020460.
%Y A385776 Cf. A000040.
%K A385776 nonn,base,easy
%O A385776 1,1
%A A385776 _Jason Bard_, Jul 09 2025