Quick Search for:  in language:    
10000,finds,prime,numbers,from,whatever,want,
   Code/Articles » |  Newest/Best » |  Community » |  Jobs » |  Other » |  Goto » | 
CategoriesSearch Newest CodeCoding ContestCode of the DayAsk A ProJobsUpload
Visual Basic Stats

 Code: 3,290,928. lines
 Jobs: 215. postings

 How to support the site

 
Sponsored by:

 
You are in:
 
Login





Latest Code Ticker for Visual Basic.
Click here to see a screenshot of this code!WheelCipher Encryption
By Michael D. on 1/5

(Screen Shot)

Blackjack games ver 1.0
By Yu Jiunn Shyang on 1/4


Click here to see a screenshot of this code!Transparent Tiler
By Roger Gilchrist on 1/4

(Screen Shot)

bitblt example with invintory, levels, and chat.
By Mike Aka Sono on 1/4


Game Programming Dilemma (DirectX or OpenGL?)
By abandoned_progr ammer on 1/4


Click here to see a screenshot of this code![[ XP Theme
By Pamela RAI on 1/4

(Screen Shot)

____Transparent class module____
By Mathieu Chartier on 1/4


[[ a1 Tie Remote MySQL DB to MSHflexgrid
By Pamela RAI on 1/4


Click here to see a screenshot of this code!internet logger, updated see info
By stephen whittle on 1/4

(Screen Shot)

Click here to put this ticker on your site!


Add this ticker to your desktop!


Daily Code Email
To join the 'Code of the Day' Mailing List click here!

Affiliate Sites



 
 
   

AWSOME Prime Number Finder!!

Print
Email
 
winzip icon
Submitted on: 11/29/2003 10:52:50 AM
By: KGabert 
Level: Advanced
User Rating: Unrated
Compatibility:VB 5.0, VB 6.0

Users have accessed this code 214 times.
 
 
     This finds all the prime numbers from 1 to whatever you want (within the limits of a long). eg, it will find all the prime numbers from 1 to 10000 in a couple milleseconds. The long time it takes with the status bar is just to display all the primes! It uses Eratosthene's Sieve, and includes a little tutorial on how that method works (its one of the fastest known). Please rate and leave feedback.

 
winzip iconDownload code

Note: Due to the size or complexity of this submission, the author has submitted it as a .zip file to shorten your download time. Afterdownloading it, you will need a program like Winzip to decompress it.

Virus note:All files are scanned once-a-day by Planet Source Code for viruses,but new viruses come out every day, so no prevention program can catch 100% of them.

FOR YOUR OWN SAFETY, PLEASE:
1)Re-scan downloaded files using your personal virus checker before using it.
2)NEVER, EVER run compiled files (.exe's, .ocx's, .dll's etc.)--only run source code.
3)Scan the source code with Minnow's Project Scanner

If you don't have a virus scanner, you can get one at many places on the net including:McAfee.com

 
Terms of Agreement:   
By using this code, you agree to the following terms...   
1) You may use this code in your own programs (and may compile it into a program and distribute it in compiled format for languages that allow it) freely and with no charge.   
2) You MAY NOT redistribute this code (for example to a web site) without written permission from the original author. Failure to do so is a violation of copyright laws.   
3) You may link to this code from another website, but ONLY if it is not wrapped in a frame. 
4) You will abide by any additional copyright restrictions which the author may have placed in the code or code's description.


Other 1 submission(s) by this author

 

 
Report Bad Submission
Use this form to notify us if this entry should be deleted (i.e contains no code, is a virus, etc.).
Reason:
 
Your Vote!

What do you think of this code(in the Advanced category)?
(The code with your highest vote will win this month's coding contest!)
Excellent  Good  Average  Below Average  Poor See Voting Log
 
Other User Comments
11/29/2003 6:40:22 PM:KGabert
Please rate and leave comments!!!
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
11/30/2003 12:59:40 PM:Jonathan D
There is a very interesting challenge 
involving prime numbers, if any one can 
accomplish this in VB please let me 
know:
1. Calculate all prime numbers 
counting down from and including this 
number.
2. Throw away every second 
prime you get.
3. Take the first digit 
and the last digit of all the prime 
numbers left, add them all 
together.
4. You will get a large 
number. Factorize that number to primes 
and add up all the factors.
5. Enter 
the answer in the format: 
'Prime:AddedDigits:AddedFactors'
Example: Number = 17
1. Primes: 
17 13 11 7 5 3 2
2. Primes: 17 11 5 
2
3. 1+7 + 1+1 + 5+5 + 2+2 = 24
4. 24 
(Not that large :P) = 12 x 2 = 6 x 2 x 
2 = 3 x 2 x 2 x 2 -> 3+2+2+2 = 9
5. 
Answer: 17:24:9
Another example: 
31337:13289:234
The time limit for 
this challenge is 3 seconds.
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
11/30/2003 1:01:38 PM:Jonathan D
Sorry, forgot to mention you need to be 
able to solve big numbers the trick is 
to do it with large numbers, like 
'5137021' or '6027661' etc, within 3 
seconds, very hard in VB!!
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
Add Your Feedback!
Note:Not only will your feedback be posted, but an email will be sent to the code's author in your name.

NOTICE: The author of this code has been kind enough to share it with you.  If you have a criticism, please state it politely or it will be deleted.

For feedback not related to this particular code, please click here.
 
Name:
Comment:

 

Categories | Articles and Tutorials | Advanced Search | Recommended Reading | Upload | Newest Code | Code of the Month | Code of the Day | All Time Hall of Fame | Coding Contest | Search for a job | Post a Job | Ask a Pro Discussion Forum | Live Chat | Feedback | Customize | Visual Basic Home | Site Home | Other Sites | About the Site | Feedback | Link to the Site | Awards | Advertising | Privacy

Copyright© 1997 by Exhedra Solutions, Inc. All Rights Reserved.  By using this site you agree to its Terms and Conditions.  Planet Source Code (tm) and the phrase "Dream It. Code It" (tm) are trademarks of Exhedra Solutions, Inc.