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

 

Logo


Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A020451 Primes that contain digits 1 and 3 only. 5
3, 11, 13, 31, 113, 131, 311, 313, 331, 3313, 3331, 11113, 11131, 11311, 13313, 13331, 31333, 33113, 33311, 33331, 113111, 113131, 131111, 131113, 131311, 311111, 313133, 313331, 313333, 331333, 333131, 333331, 1111333, 1131113, 1131131, 1131133, 1131331 (list; graph; refs; listen; history; text; internal format)
OFFSET

1,1

LINKS

Vincenzo Librandi, Table of n, a(n) for n = 1..1000

MAPLE

N:= 8: # to get all a(n) with at most N digits

S:= {}:

for d from 1 to N do

  r:= (10^d-1)/9;

  S:= S union select(isprime, map(`+`, map(convert, combinat[powerset]

      ({seq(2*10^i, i=0..d-1)}), `+`), r));

od:

S; # if using Maple 11 or earlier, uncomment the next line

# sort(convert(S, list)); # Robert Israel, May 04 2015

MATHEMATICA

Flatten[Table[Select[FromDigits/@Tuples[{1, 3}, n], PrimeQ], {n, 7}]] (* Vincenzo Librandi, Jul 27 2012 *)

PROG

(MAGMA) [p: p in PrimesUpTo(1131331) | Set(Intseq(p)) subset [1, 3]];

// Bruno Berselli, Jul 27 2012

(Python)

import sympy

def check13(a):

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

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

n=2

while n>1:

....if check13(n)==True:

........print(n)

// Abhiram R Devesh, May 04 2015

CROSSREFS

Subsequence of A045429.

Sequence in context: A260044 A199303 A244047 * A018450 A302304 A119145

Adjacent sequences:  A020448 A020449 A020450 * A020452 A020453 A020454

KEYWORD

nonn,base

AUTHOR

David W. Wilson

STATUS

approved

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 October 13 19:35 EDT 2019. Contains 327981 sequences. (Running on oeis4.)