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.

A386047 Primes having only {0, 2, 4, 7} as digits.

This page as a plain text file.
%I A386047 #8 Jul 15 2025 21:16:25
%S A386047 2,7,47,227,277,727,2027,2207,2447,2477,2707,2777,4007,4027,4447,7027,
%T A386047 7207,7247,7477,7727,20047,20407,20477,20707,20747,22027,22247,22277,
%U A386047 22447,22727,22777,24007,24077,24247,24407,27077,27277,27407,27427,40277,40427,42227
%N A386047 Primes having only {0, 2, 4, 7} as digits.
%H A386047 Jason Bard, <a href="/A386047/b386047.txt">Table of n, a(n) for n = 1..10000</a>
%H A386047 <a href="/index/Pri#PrimesWithDigits">Index to entries for primes with digits in a given set</a>
%p A386047 f:= n-> (l-> add([0, 2, 4, 7][l[j]+1]*10^(j-1), j=1..nops(l)))(convert(n, base, 4)):
%p A386047 select(isprime, [seq(f(i), i=0..600)])[];  # _Alois P. Heinz_, Jul 15 2025
%t A386047 Select[FromDigits /@ Tuples[{0, 2, 4, 7}, n], PrimeQ]
%o A386047 (Magma) [p: p in PrimesUpTo(10^6) | Set(Intseq(p)) subset [0, 2, 4, 7]];
%o A386047 (Python) print(list(islice(primes_with("0247"), 41))) # uses function/imports in A385776
%o A386047 (PARI) primes_with(, 1, [0, 2, 4, 7]) \\ uses function in A385776
%Y A386047 Supersequence of A261267, A384449, A385784.
%Y A386047 Cf. A000040, A030432, A385776.
%K A386047 nonn,base,easy
%O A386047 1,1
%A A386047 _Jason Bard_, Jul 15 2025