login
This site is supported by donations to The OEIS Foundation.

 

Logo


Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A020452 Primes that contain digits 1 and 4 only. 9

%I

%S 11,41,4111,4441,11411,14411,41141,41411,44111,1114111,1144141,

%T 1144441,1411141,1411411,1441411,1444111,1444411,1444441,4141441,

%U 4414411,4441111,4441441,11111141,11141111,11141441,11441141,11441411,14111441,14141411

%N Primes that contain digits 1 and 4 only.

%H Vincenzo Librandi, <a href="/A020452/b020452.txt">Table of n, a(n) for n = 1..1000</a>

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

%o (MAGMA) [p: p in PrimesUpTo(14141411) | Set(Intseq(p)) subset [1,4]]; // _Bruno Berselli_, Jul 27 2012

%o (Python)

%o import sympy

%o def checkd(a,c):

%o ....b=[int(i) for i in list(set(list(str(a))))]

%o ....return(set(b).issubset(c))

%o n=2

%o while n>1:

%o ....if checkd(n,[1,4])==True:

%o ........print(n)

%o ....n=sympy.nextprime(n)

%o // _Abhiram R Devesh_, May 08 2015

%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 | Recent
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 18 08:37 EDT 2019. Contains 322209 sequences. (Running on oeis4.)