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.

A079651 Primes having only {1, 4, 7} as digits.

This page as a plain text file.
%I A079651 #23 Jul 20 2025 18:02:43
%S A079651 7,11,17,41,47,71,1117,1171,1447,1471,1741,1747,1777,4111,4177,4441,
%T A079651 4447,7177,7411,7417,7477,7717,7741,11117,11171,11177,11411,11447,
%U A079651 11471,11717,11777,14177,14411,14447,14717,14741,14747,14771,17117,17417
%N A079651 Primes having only {1, 4, 7} as digits.
%C A079651 The number of decimal digits of a(n) is never divisible by 3. - _Robert Israel_, May 22 2014
%C A079651 The smallest prime using only all three straight digits is a(9) = 1447 (see Prime Curios! link). - _Bernard Schott_, Sep 08 2023
%H A079651 Robert Israel, <a href="/A079651/b079651.txt">Table of n, a(n) for n = 1..10000</a>
%H A079651 Chris K. Caldwell and G. L. Honaker, Jr., <a href="https://t5k.org/curios/page.php?short=1447">1447</a>, Prime Curios! [Gupta]
%H A079651 <a href="/index/Pri#PrimesWithDigits">Index to entries for primes with digits in a given set</a>
%e A079651 17 is a term because it is a prime and consists of straight digits 1 and 7 only.
%p A079651 f:= proc(x) local n,d,t,i,a;
%p A079651 n:= floor(log[3]((2*x+3)));
%p A079651 if n mod 3 = 0 then return 0 fi;
%p A079651 d:=x - (3^n - 3)/2;
%p A079651 t:= 0;
%p A079651 for i from 0 to n-1 do
%p A079651    a:= d mod 3;
%p A079651    t:= t + (3*a+1)*10^i;
%p A079651    d:= (d-a)/3;
%p A079651 od:
%p A079651 t
%p A079651 end proc:
%p A079651 select(isprime, map(f, [$1..1000])); # _Robert Israel_, May 22 2014
%t A079651 Select[Prime[Range[2000]], Union[ Join[ IntegerDigits[ # ], {1, 4, 7}]] == {1, 4, 7} &]
%o A079651 (PARI) straight(n)=my(t);while(n,t=n%10;if(t!=1&&t!=4&&t!=7,return(0));n\=10);!!t
%o A079651 select(straight, primes(1000)) \\ _Charles R Greathouse IV_, Sep 25 2012
%Y A079651 Cf. A028373.
%K A079651 base,nonn
%O A079651 1,1
%A A079651 _Shyam Sunder Gupta_, Jan 23 2003
%E A079651 Corrected and extended by _Robert G. Wilson v_, Jan 24 2003