Results 1 to 9 of 9

Thread: Prime: find prime number >N

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Programmer Bulat Ziganshin's Avatar
    Join Date
    Mar 2007
    Location
    Uzbekistan
    Posts
    4,537
    Thanks
    758
    Thanked 676 Times in 366 Posts

    Prime: find prime number >N

    i just wrote small program that prints smallest prime larger than N. meanwhile it also prints nonprime numbers that don't have deividers less than 1000. program transcript:

    C:\>gcc -O2 prime.cpp

    C:\>t a.exe 1112223334445556667
    1112223334445556667
    1112223334445556682 / 39509
    1112223334445556701 / 7640263
    1112223334445556703 / 550208699
    1112223334445556719 is prime!!!

    Elapsed time = 31.840 seconds


    C:\>t a.exe 11122233344455566678
    11122233344455566678
    11122233344455566679 is prime!!!

    Elapsed time = 68.262 seconds
    Attached Files Attached Files

Similar Threads

  1. Euler's Number Triangle and Random Data
    By BetaTester in forum Data Compression
    Replies: 55
    Last Post: 19th February 2013, 04:02
  2. Replies: 41
    Last Post: 25th December 2012, 10:16
  3. Compression via Number Factorisation
    By MiY4Gi in forum Random Compression
    Replies: 14
    Last Post: 20th July 2012, 18:51
  4. rnd - simple pseudo random number generator
    By encode in forum Forum Archive
    Replies: 21
    Last Post: 14th January 2008, 02:41
  5. I cannot find jpegoptim win32 build
    By SvenBent in forum Forum Archive
    Replies: 2
    Last Post: 30th November 2007, 22:41

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •