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

 

Logo

The submissions stack has been unacceptably high for several months now. Please voluntarily restrict your submissions and please help with the editing. (We don't want to have to impose further limits.)

Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A160337 1 plus primes using only digits {0, 1, 2, 3, 5, 7}. 0
1, 2, 3, 5, 7, 11, 13, 17, 23, 31, 37, 53, 71, 73, 101, 103, 107, 113, 127, 131, 137, 151, 157, 173, 211, 223, 227, 233, 251, 257, 271, 277, 307, 311, 313, 317, 331, 337, 353, 373, 503, 521, 523, 557, 571, 577, 701, 727, 733, 751, 757, 773, 1013, 1021, 1031 (list; graph; refs; listen; history; text; internal format)
OFFSET

1,2

COMMENTS

Since the first 5 primes numbers are 1,2,3,5,7 (1 included), so the rest of the numbers can be generated by using numbers from the set {0,1,2,3,5,7} as every digit must be a prime number as well.

LINKS

Table of n, a(n) for n=1..55.

EXAMPLE

For n = 3 the solutions are ... 1,2,3

PROG

(C++)

#include <iostream>

using namespace std;

bool isPrime(long n)

{

    if(n==0) return true;

    for(long i = 2; i<=n/2; i++) { if(n%i == 0) return false; }

    return true;

}

bool checkdigit(long n)

{

    long no = n;

    while(no>0)

    {

        long digit = no%10;

        if(digit==0) return false;

        else { if(!isPrime (digit)) return false; }

        no = no/10;

    }

    return true;

}

int main()

{

    long limit = 1000000000; int count =0;

    for(long i=1; i<=limit; i++)

    {

        if(isPrime(i) && checkdigit(i))

        { count++; cout<<i<<endl; }

        if(count == 100) { return 0; }

    }

    return 0;

}

CROSSREFS

Cf. A012884, A143390

Sequence in context: A143390 A038617 A036962 * A190222 A012884 A068669

Adjacent sequences:  A160334 A160335 A160336 * A160338 A160339 A160340

KEYWORD

nonn,base

AUTHOR

Mohit Singh Kanwal (mohit_kanwal(AT)hotmail.com), May 10 2009

STATUS

approved

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

Content is available under The OEIS End-User License Agreement .

Last modified August 28 05:09 EDT 2015. Contains 261118 sequences.