Posted by
கேசவன் முத்துவேல்
"An integer is prime if its only positive divisors are itself and one. Prime numbers have always been a keen interest to mathematicians for various reasons. One being there appears to be no rhyme or reason to the distribution of primes and there is no limit to finding new primes. The largest known prime was found in November 2001 and it is over 4 million digits long! (see other links below) Finding Primes Computers have made finding these large prime numbers possible. The faster computers can crunch numbers, the larger the primes will be found. Here's an interesting graph showing the largest known primes by year. Simple Method of Finding Primes A prime number is one that has no prime factors. So a simple way of checking if a number is prime is by trying all known primes less than it and seeing if it divides evenly into that number. Example: Finding the first couple of primes Starting off with the number 2, it is prime because the only divisors are itself and 1, meaning the only way to multiple two numbers to get 2 is 2 x 1. Likewise for 3. So that starts us off with two known primes 2 and 3. To check the next number we can check if 4 modulo 2 equals 0. This means when divide 2 into 4 there is no remainder, which means 2 is a factor of 4. Specifically we know 2 x 2 = 4. Thus 4 is not prime. Moving on to the next number: 5. To check"
ANY ONE RUN THIS C Program.., & Enjoy the primes..,
/*
Prime Number Finder
Marcus Kazmierczak, marcus@mkaz.com
Created On: March 18, 2002
# findthem.c $Revision: 1.3 $
# Last Updated: $Date: 2002/03/19 06:59:11 $
*/
#include
#include
/*== start/stop range ==*/
#define START 5 // MUST BE ODD
#define STOP 99999999
int main(void)
{
int nap;
long num, c, i;
long *prime;
prime = malloc((STOP/3) * sizeof(long));
if (!prime) { printf("Memory Allocation Error."); exit(1); }
prime[0] = 2; prime[1] = 3;
c = 2; /*== initial primes ==*/
/*== only have to check odd numbers ==*/
for (num=START; num < STOP; num = num + 2)
{
nap = 0; // set not-a-prime false
/*= cycle through list of known primes =*/
for (i=0; i < c; i++)
{
/*= check if a previous prime divides evenly =*/
/*= if so the number is not a prime =*/
if ((num % prime[i]) == 0) { nap = 1; break; }
/*= stop if prime squared is bigger than the number =*/
if ((prime[i] * prime[i]) > num) { break; }
}
/*= if not-a-prime, then we found a prime =*/
if (nap != 1)
{
/*= add prime to list of known primes =*/
prime[c] = num; c++;
printf("%d \n",num);
}
}
free(prime);
}
Thanks : mkaz.com:
2 comments:
[url=http://www.onlinecasinos.gd]Online casinos[/url], also known as physical mark casinos or Internet casinos, are online versions of well-known ("crony and mortar") casinos. Online casinos concurrence gamblers to reorganize and wager on casino games with the grant-money the Internet.
Online casinos typically volunteer odds and payback percentages that are comparable to land-based casinos. Some online casinos let go by higher payback percentages in the mending of span ploy games, and some shred the hot element about payout proportion audits on their websites. Assuming that the online casino is using an meetly programmed unspecific myriad generator, data games like blackjack clothed an established feign index edge. The payout model up during these games are established to the substance the rules of the game.
Unmistakeable online casinos sublease or apprehension their software from companies like Microgaming, Realtime Gaming, Playtech, Worldwide Confidence trick Technology and CryptoLogic Inc.
top [url=http://www.001casino.com/]001[/url] check the latest [url=http://www.casinolasvegass.com/]casino online[/url] free no consign perk at the best [url=http://www.baywatchcasino.com/]online casino
[/url].
Post a Comment