login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A020465 Primes that contain digits 4 and 7 only. 5

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

%S 7,47,4447,7477,44777,47777,74747,77447,77477,77747,4444747,4447747,

%T 4747747,4774477,4774747,7444477,7447777,7474477,7477777,7747477,

%U 7774777,7777447,44447747,44747447,44747777,44774777,47447747,47774477,47774747

%N Primes that contain digits 4 and 7 only.

%H Alois P. Heinz, <a href="/A020465/b020465.txt">Table of n, a(n) for n = 1..20000</a> (first 1000 terms from Vincenzo Librandi)

%H James Maynard and Brady Haran, <a href="https://www.youtube.com/watch?v=eeoBCS7IEqs">Primes without a 7</a>, Numberphile video (2019)

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

%o (Magma) [p: p in PrimesUpTo(47774747) | Set(Intseq(p)) subset [4, 7]]; // _Vincenzo Librandi_, Jul 27 2012

%o (Python)

%o from sympy import isprime

%o from itertools import count, takewhile

%o def A284971(n):

%o b = bin(n+1)[3:]

%o return int("".join(b.replace("0", "4").replace("1", "7")))

%o def aupto(limit):

%o return list(filter(isprime, takewhile(lambda x: x <= limit, (A284971(n) for n in count(1)))))

%o print(aupto(47774747)) # _Michael S. Branicky_, Apr 07 2021

%Y Cf. A284971.

%K nonn,base

%O 1,1

%A _David W. Wilson_

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 24 08:13 EDT 2024. Contains 371922 sequences. (Running on oeis4.)