| View previous topic :: View next topic |
| Author |
Message |
Jingle47
Daedalian Member
|
Posted: Tue Apr 16, 2002 4:33 am Post subject: 1 |
|
|
I am doing a little digging and am working with prime factorizations.
What I reall want to know is how YOU figure out if the following number is prime.
100000000000000000207
I actually already know whether it is prime or not, I am more interested in your approach(es).
I would appreciate any help I can get and who knows you might find it fun to do anyway! |
|
| Back to top |
|
 |
Chuck
Daedalian Member
|
Posted: Tue Apr 16, 2002 7:09 am Post subject: 2 |
|
|
| I used a program called PRNTEST1.UB that came with the UBasic programming language that I found online somewhere months ago. I don't know how it works. It says 100,000,000,000,000,000,207 is prime. |
|
| Back to top |
|
 |
ctrlaltdel
Member of the Daedalians
|
Posted: Tue Apr 16, 2002 7:37 am Post subject: 3 |
|
|
is there a way 'around' the problem?
say i look at the big number and say:
207 is not a prime, 207 = 23 x 3 x 3
now if 10000000000000000000 is divisible by either 23 or 3 then the whole number is not a prime
if its not tho... then i guess i don't know yet
anyways an approach like this maybe totally misleading only because of the bunch of zeros i try to enforce it on the problem. if the number was something like 13215746545135464316545207 i'd be stuck with the brute force efforts.
[This message has been edited by ctrlaltdel (edited 04-16-2002 03:39 AM).] |
|
| Back to top |
|
 |
groza528
No Place Like Home
|
Posted: Tue Apr 16, 2002 7:55 am Post subject: 4 |
|
|
It may be a difference of two squares, in which case it is not prime. That's probably the first thing I'd check is what's the next square, and then find the difference between the two. Unfortunately I'm too lazy to do that.
Is that supposed to be ...00207 or ...027? |
|
| Back to top |
|
 |
groza528
No Place Like Home
|
Posted: Tue Apr 16, 2002 7:55 am Post subject: 5 |
|
|
| If ...027 there's probably a difference of two cubes formula |
|
| Back to top |
|
 |
mole
Subterranean Member
|
Posted: Tue Apr 16, 2002 9:21 am Post subject: 6 |
|
|
| 13215746545135464316545207 is not prime. |
|
| Back to top |
|
 |
CrystyB
Misunderstood Guy
|
Posted: Tue Apr 16, 2002 10:19 pm Post subject: 7 |
|
|
Groza, except 10^20 is not a cube  |
|
| Back to top |
|
 |
Quailman
His Postmajesty
|
Posted: Tue Apr 16, 2002 10:26 pm Post subject: 8 |
|
|
| If it had nine or fewer digits, I would look here. |
|
| Back to top |
|
 |
CzarJ
Hot babe
|
Posted: Wed Apr 17, 2002 1:38 am Post subject: 9 |
|
|
Oh, I read about stuff like this in a book! I don't really understand how it works, though
------------------
Speaking of which, describe your favorite pair of pants. |
|
| Back to top |
|
 |
Jingle47
Daedalian Member
|
Posted: Wed Apr 17, 2002 5:01 am Post subject: 10 |
|
|
I found out the answer using a program called Maple 6.
But I am kind of curious how Maple found the answer. |
|
| Back to top |
|
 |
SaberKitty
one can always be hopeful...
|
|
| Back to top |
|
 |
Griffin
Daedalian Member
|
|
| Back to top |
|
 |
jamesshuang
Icarian Member
|
Posted: Tue Apr 23, 2002 7:15 pm Post subject: 13 |
|
|
| TI-89 calculators rule. They are great for finding primes. 100000000000000000207 is actually prime, by the way. |
|
| Back to top |
|
 |
extropalopakettle
No offense, but....
|
Posted: Thu Apr 25, 2002 2:29 am Post subject: 14 |
|
|
Here's a java program to test if any integer is prime or not:
code:
import java.math.BigInteger;
class testPrime
{
public static void main(String[] args)
{
BigInteger n = new BigInteger(args[0]);
if (n.isProbablePrime(30))
System.out.println("PRIME");
else
System.out.println("COMPOSITE");
}
}
The constant 30 can be changed. The higher it is, the less likely it is you'll get a false positive (positive=prime). You'll never get a false negative. For a value of X, the probability that a positive result is false is less than 1/2^X. |
|
| Back to top |
|
 |
|