There are 172 primes less than 1024 and the largest is 1021.
I asked myself a similar question and wrote a little procedure.
FWIW 9592 primes < 100 000, largest is 99991.
Glad you asked.
2007-09-04 07:44:30
·
answer #1
·
answered by ? 5
·
0⤊
0⤋
You could just use a "brute force" method, individually testing the numbers up through 1024. Obviously you can take shortcuts though. Any even number greater than 2 can't be prime. Any number other than 5 that ends in 5 is divisible by 5. So that eliminates well over half the numbers to check.
Also, when checking to see what multiples a number might have, you only have to check with all the previous prime numbers. This is because if a number isn't prime, then it's a multiple of some other numbers, which in turn are multiples of other numbers and so on until you get to just a set of prime numbers.
Another helpful rule is that you only have to check up through the square root of a number for factors. This is because factors always come in pairs, with one number being less than the square root and one number being greater than it (or in the case of perfect squares, both factors are the same and the square root). So even when it comes to checking 1023, you only have to check by dividing it by all of the primes up to 31.
So the first few primes are 2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31. In fact, this is all we need to test with. Now continue testing all the other odd numbers that don't end in 5. 33 is divisible by 11, so that isn't prime. The square root of 37 is somewhere between 6 and 7, so we only have to test it with 2, 3, 5, none of which work, so it's prime. 39 is divisible by 3. 41 isn't divisible be 2, 3, or 5, and we don't have to test with anything higher since 7*7 = 49, so it's prime. Keep continuing on like this.
2007-09-04 14:27:32
·
answer #2
·
answered by Anonymous
·
0⤊
0⤋
I used the CRC handbook of math tables
which states that there are 168 primes less than 1000.
With the aid of PARI I found that the only primes
between 1001 and 1024 are1009,1013,1019
and 1021.So the total number of primes less than
1024 is 172.
2007-09-04 15:36:29
·
answer #3
·
answered by steiner1745 7
·
0⤊
0⤋
Ok. Just go through and individually test numbers. That's the only way I can think of. Painstaking, I know.
Some stuff to make it easier:
-Stuff ending in an even number is not prime (other than the number 2, itself), as it is divisible by 2.
-If you add up all the digits, and it comes out to be a multiple of 3, it is not prime, as it is divisble by 3. (except for 3, itself)
ex. 861. adding up the digits gives you 15, which is a multiple of 3. 861/3 = 287.
-If it ends in 5 or 0, it is divisible by 5 and is not prime.
That eliminates a good portion of the numbers
2007-09-04 14:31:38
·
answer #4
·
answered by ǝɔnɐs ǝɯosǝʍɐ Lazarus'd- DEI 6
·
0⤊
0⤋
172 - I counted them. I am not sure how to do this the way you want. Are you sure you want prime and not binary or something? 1024 is binary number kind make think you want something else.
2007-09-04 14:31:46
·
answer #5
·
answered by Paul T 2
·
0⤊
0⤋