Click here to Skip to main content
15,892,298 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
I'm new in high mathematics. So I am writing a program for android. It is working offline and it is about math. In my program the biggest number is the biggest number your device can understand. I mean if tomorrow they make a android phone that has very powerful processor then you can get and use a much more bigger number.

My questions is. How is working PrimeQ and which is the fastest way to check if the number is prime or not for sure, not probably.

What I have tried:

Right now I'm using simplest way. Brute force till √(n) . Where n is the entered number. I can send apk if you need.

Thanks...
Posted
Updated 31-Jul-17 20:57pm
v4

You absolutely need to learn Google.
There huge amount of information about primality and factorization.
Quote:
In my program the biggest number is the biggest number your device can understand.

Most languages can handle BigInt numbers (virtually infinite integers).
Quote:
My questions is. How is working PrimeQ
You only forgot to tell us the language you use. Using Google and reading documentation will probably give you many informations about this, faster than us and with much more details.
 
Share this answer
 
The starting point could be the Wikipedia page[^] on the topic.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900