Jump to content

Is there no test for a number that is Prime?

Featured Replies

4 hours ago, Trurl said:

But if that number is so large that you can’t factor it, multiplying it by a Prime number may change the perspective and create more factors.

No. Multiplying a number by a prime number only increases the number of factors by one, the prime number you multiplied the number with. You do know that the factorisation of a number into primes is unique up to order, don't you?

  • Author
55 minutes ago, KJW said:

No. Multiplying a number by a prime number only increases the number of factors by one, the prime number you multiplied the number with. You do know that the factorisation of a number into primes is unique up to order, don't you?

You are correct. But I am did not lie. I said unknown number if Prime, times known Prime would create 2 more factors because the number is now a semiPrime.

Which doesn’t prove it is useful.

But I will leave you with this thought. Do you agree or disagree that the ability to factor semiPrimes or even identifying them would result in the solution of all Primes numbers?

That is why I take unknown Prime times Prime to form semiPrimes as a Primality test. That is why I mention this method that seems redundant and foolish but contains a hidden problem.

I am not trained in number theory. It would take me days just to learn the notation to some of these sieves. It could be my redundant multiplication makes the numbers larger. But what if I state the redundancy of this method is useful if you can find within doubt that a semiPrime is formed; By multiplying the unknown number by a known Prime.

Say your unknown (if prime or not) number is 3,343. Multiply it by 5 (which you know is a prime) to get 16,715

Exactly what will you do with 16,715 that is any easier/better/faster than just doing the same thing with 3,343 ?

Enough with the hopes and dreams.

20 hours ago, Trurl said:

You are correct a composite number made lager isn’t always necessary.

Correct about what? "isn’t always necessary" is wrong,"is never useful"* would be correct if referring to anything I said.

Anyway, please demonstrate one case when a composite number made lager is necessary*. That would prove me wrong?

20 hours ago, Trurl said:

A Prime times a Prime is a semiPrime.

Yes that follows from the definition, so that is correct. The rest makes no sense.

*) in the context of this thread, primality test, of course.

  • Author

What I said makes perfect sense:

Prime times composite equal composite.

Prime time semiPrime equals composite.

Prime times Prime equals semiPrime.

And if you can factor that semiPrime within reasonable, you have just solved the pattern of Prime numbers.

The purpose of the multiplication is to increase the number of factors and know what the Prime factors of the newly created semiPrime.

That is all. It is less than 1 minute observation. I don’t know that you are trying to understand what I am saying or just trying to destroy my idea. Which is ok because I welcome the challenge, but the above is what I claimed from the 1st post.

23 minutes ago, Trurl said:

Prime times composite equal composite.

Prime time semiPrime equals composite.

Prime times Prime equals semiPrime.

The above makes sense. The rest does not.

28 minutes ago, Trurl said:

The purpose of the multiplication is to increase the number of factors and know what the Prime factors of the newly created semiPrime.

Take a look at the cartoon I posted.

4 hours ago, Trurl said:

... The purpose of the multiplication is to increase the number of factors and know what the Prime factors of the newly created semiPrime. ...

But how do you know it's semi-prime?!

And again, what method are you using to get that knowledge, that couldn't have just been applied to the original number?

Edited by pzkpfw

On 9/12/2025 at 1:10 PM, Trurl said:

That is why I take unknown Prime times Prime to form semiPrimes as a Primality test. That is why I mention this method that seems redundant and foolish but contains a hidden problem.

IF you have a test for semiprime that is simpler than a test for prime, then multiplying the number by a prime would simplify the test for prime. But that's a big hypothetical IF. I don't think it's likely that such a test exists, and even if such a test does exist, I think it would be above the pay grade of both you and I to find it. Nevertheless, the idea that there might be a test for semiprime that is simpler than a test for prime is actually not a bad idea.

Edited by KJW

2 hours ago, KJW said:

IF you have a test for semiprime that is simpler than a test for prime, then multiplying the number by a prime would simplify the test for prime.

Not necessarily a bad analogy but logically it works only if you already know that the original number (let's call it n) is prime (and hence have no need for a test)? If n is semiprime the multiplication results in a larger composite making the test slower than running the (hypothetical) algorithm on n. Also note the state of the art algorithms for primality tests are extremely fast compared to composite (or semi prime) tests. (I resented comparisons in an earlier post)

2 hours ago, KJW said:

Nevertheless, the idea that there might be a test for semiprime that is simpler than a test for prime is actually not a bad idea.

It would certainly be of interest in cryptography? Since for instance RSA build on the fact that testing for prime is easy compared to factoring.

  • Author

Well there is a difference between not making sense and saying it is not useful.

One of the reason to use this method is having no knowledge of a factor being Prime or semiPrime.

You say you’d never use it on a composite, but what if the composite was 32 digits and ended in 99? (I’m still working to make better examples. I know this one needs clarification.)

You say it is redundant and makes the given number larger. I argue that as little as 3 times the size may increase it but yields a number easier to factor; sometimes.

But what if I didn’t have a sieve and I wanted to find Primes between two larger numbers. Finding a Prime I didn’t know would be hard. So I would take every odd number between those numbers and multiply by 5. (It’s not division and it is only multiplying one time each number.) Would factoring these new numbers and proving they are semiPrime be harder then recursive division of these same numbers? That is the question.

I know there are other more advanced algorithms, but now I am concentrated on this one.

It may or not be useful. But I simply test would be to take your entire table you are sieving and multiply each number in question by 3 and sieve again.

It produces slightly larger numbers you would factor in the future of the sieve anyway. By this I mean you will sieve these large numbers later as the sieve progresses anyway. Why not skip the smaller numbers?

But does a standard sieve make it possible to eliminate Prime values without a continuous sieve? By this I mean starting at a given values not a continuous line from start to zero. Can your sieve start at numbers in the millions without a known starting point?

I could be wrong of course but the forum is to test ideas. But as you guys pointed out a semiPrime test would give my test reason. But as I have stated in the past factoring semiPrimes is the key to finding a pattern in Primes.

16 hours ago, Trurl said:

Well there is a difference between not making sense and saying it is not useful.

Your ideas about prime numbers may have some use in a work of fiction, poetry or similar. Or maybe in computer education; "find one major flaw in this attempt at an algorithm (correct answer: the unnecessary multiplication)"? In mathematics, where this is posted, I fail to find your ideas about primes useful.

16 hours ago, Trurl said:

You say you’d never use it on a composite, but what if the composite was 32 digits and ended in 99? (I’m still working to make better examples. I know this one needs clarification.)

What if? As I said above:

On 9/12/2025 at 8:30 PM, Ghideon said:

Anyway, please demonstrate one case when a composite number made lager is necessary*.

On 9/11/2025 at 11:18 PM, Trurl said:

But the method would prove more useful if there was a reliable method to factor semiPrimes.

There are many reliable methods for factoring semiprimes.

  • Author
On 9/14/2025 at 4:57 PM, Ghideon said:

There are many reliable methods for factoring semiprimes.

Well if you know methods to find semiPrimes please share. I will show you a use to find the Prime number that multiplying by a known Prime number would aid in finding the product of the semiPrime.

I need to find all Prime numbers where

the smaller Prime factor is between 1.0 * 10^90 and 1.0 * 10^130

So I would multiply every odd number by the arbitrary Prime 5. Find new semi semiPrimes and divide those original Prime number values into:

Clear[x, y, g, pnp]

pnp = 2211282552952966643528108525502623092761208950247001539441374831\

912882294140\

   2001986512729726569746599085900330031400051170742204560859276357953\

757185954\

   2988389587092292384910067030341246205457845664136645406842143612930\

176940208\

   46391065875914794251435144458199;

1 hour ago, Trurl said:

Well if you know methods to find semiPrimes please share

What do you mean by find semiprimes?

You asked about factoring:

On 9/11/2025 at 11:18 PM, Trurl said:

if there was a reliable method to factor semiPrimes.

Edited by Ghideon

  • Author
On 9/14/2025 at 4:57 PM, Ghideon said:

There are many reliable methods for factoring semiprimes.

Are there any methods to factor large semiPrimes? I showed you how I would approach the Prime factorization problem. If it works or not. I am concerned with the method. I multiply all odd numbers by five so as studiot pointed out you only have to test the numbers that end in 5.

I would not bother to factor the ones that end in 5. Instead I would take the original Prime numbers and divide into the semiPrime factor that is too large to factor.

This may be hard to understand but I think even if you don’t believe my method to find the large semiPrime you might agree that multiplying by 5 eliminates impossible work.

I think you will be able to follow my process because all the steps are there. There is much going on here and I am not the best teacher.

I'll try again, providing different answers since the questions are different

On 9/11/2025 at 11:18 PM, Trurl said:

if there was a reliable method to factor semiPrimes.

There exists many algorithms to factor semi primes. I have to assume that "reliable" means "deterministic" in contrast to probabilistic. An example is trial division; for any given semi prime n=p*q (p and q primes) trial division will always find the factors. It is 100% reliable; there are to semi primes n where the algorithm produces incorrect factors*. GNFS is another algoritm.**

19 hours ago, Trurl said:

Well if you know methods to find semiPrimes please share.

A semi prime is the product of two primes. Finding semiprimes can be done by iterating through lists of prime numbers and multiplying them.

12 hours ago, Trurl said:

Are there any methods to factor large semiPrimes?

That is again a different question. Trial division and GNFS have no upper bounds; any finite semiprime can be factored by the algorithms. It does not matter if the semiprime is large, the algorithms will eventually terminate and produce the correct factors. Then of course is the practical question; how you define "large", can large semipimes be factored given available resources (time and computing power). Factoring a semiprime that is the product of two large primes of similar sizes is inefficient and practically impossible if n is large enough.

How this is related to your idea about multiplication and working with 5*n i have no clue. The cartoon still explains the situation.

*) of course assuming algorithm execution is correct.
**) General Number Field Sieve; the most efficient currently known algorithm for factoring

You could of course see if Euclid's method for finding the HCF can be combined with your proposal, to find factors, as it already seems to be a modification of it.

  • Author
3 hours ago, studiot said:

You could of course see if Euclid's method for finding the HCF can be combined with your proposal, to find factors, as it already seems to be a modification of it.

Right on studiot! I didn’t know that is what is was but I am using that method to narrow the number of factoring by division tests.



Out[75]= 1.130565606218652*10^100

Out[76]= 1.955908211597676*10^159

Out[77]= 2.211282552952967*10^259

Out[75] is my estimate of the smaller semiPrime factor

Out[76] is the larger semiPrime factor

HCF is then used because as out75 increases out76 decreases and vise versa.

Out[77] is the estimate of N or the semiPrime factor we wish to factor

The Prime numbers between the HCF are those we need to divide into N.

That is were multiplying by 5 comes in. Also I thought if the 6x+-1 could find Primes within a set area I could find the exact Prime and not just an estimate. I thought I could use the sieve to magnify the values to the N semiPrime I wished to find.

23 hours ago, Trurl said:

I didn’t know that is what is was but I am using that method to narrow the number of factoring by division tests.

Can you present an example, how is Euclid used in your method? How it is related to your " multiplying by 5"?

Yet another ridiculous thread about prime numbers. Sigh.

On 9/8/2025 at 3:19 AM, Trurl said:

I don’t always approach math scientifically. Sometimes intuitively.

You can use your intuition when talking to a girl you don't know.. And even more so if you are familiar with her... ;)

On 9/8/2025 at 3:19 AM, Trurl said:

The Prime by prime equals semiPrime I don’t think is a complex thought. That is to be not tried before. It is just a fast observation.

..because it does not make sense..

I'm beginning to doubt your mathematical abilities..

a*b*c = d

a*b*c*5 = d*5

Using a prime number (e.g., 5) still gives the same factors (if d was not prime).

On 8/31/2025 at 3:37 PM, studiot said:

The only guaranteed test I know of is to keep an ever growing list of primes, starting with 2.

But you don't know which numbers are primes, smaller than ‘value’... Unless you create a database.. Reading from the database will take up a lot of processor time.

On 8/31/2025 at 3:37 PM, studiot said:

Clearly your test requirement will be for a number X larger than the largest prime on your list.

So starting with 2 successively divide primes from your list into X

If no prime on your list divides into X ( ie there is zero remainder) then continue dividing odd numbers greater than your largest prime but less than X until you reach X itself.

If none of these numbers divides X then X is prime.

In other words, you are talking about an algorithm like this:

#include <stdio.h>

bool is_prime( int value ) {
	if( value < 2 ) return( false );
	if( value == 2 ) return( true );
	for( int i = 2; i < value; i++ ) {
		if( ( value % i ) == 0 ) return( false );
	}
	return( true );
}

int main() {
	for( int i = 1; i < 100; i++ ) {
		if( is_prime( i ) ) {
			printf( "%d is prime!\n", i );
		}
	}
	return( 0 );
}

Use:

g++ primes.cpp -o primes

to compile the code in C/C++.

No, this is not a good algorithm. Anyone who knows mathematics knows that:

a*b=c

and that

b*a=c

For example, if you are checking whether the number 19 is prime or not, you do not need to perform modulo on the numbers 11, 13, and 17.

So, in the simplest form, make loops only up to value/2 (because more than that doesn't make sense).

After this operation, you have accelerated your code twice.

Knowing that the only prime number that is even is 2, you increase the counter by 2, skipping even numbers. This way, you already achieve a fourfold acceleration of the algorithm.

When reading prime numbers from a previously generated database, the biggest bottleneck after a certain amount of time will be the lookup of data records from the database itself.

On 8/31/2025 at 5:59 AM, Trurl said:

it is not a sieve you need but a test for Prime numbers to complete the computation problem.

Sieve is a very easy algorithm. You buy a 1 TB NVMe/SSD disk and you are able to make a map of primes from 0 to 8.796093022*10^12. One bit for one number. I just suspect that you wouldn't have had enough time.

Then you have a database of these prime numbers.

But why do you need them at all?

I've told you a few times, learn to program. Without programming, you can't do anything here. You can figure out about the first few hundred on a piece of paper. And if you spend your life on it, a few thousand. And it will still be full of mistakes (as you can see in this thread).

If you generated (algorithm in C/C++ above) all prime numbers, e.g., from 0 to 2^32 (~ 4.3 bln), put them in a database or .txt file so that they could be easily grepped (Linux: grep), you could play around with making some statistics that would allow you to assess when and under what circumstances we have larger groups of prime numbers, and when we have fewer.

For example, it seems to me that decimal numbers with an even number of digits have fewer prime numbers. Take the number 1111, for example. You don't need to do any complicated calculations to see that it has a built-in pattern, 11 * 101. This does not work with numbers that have an odd (and prime) number of decimal digits. The same is true when the number is converted to binary. For example, we have %1101111011, an even number of binary digits, and we see the pattern %11011 * %100001.

Based on this thesis, one can suspect that non-prime numbers occur more frequently when the number of digits (e.g. decimal, binary) is also a non-prime number.

To reject a number as not being prime, it is sufficient to find any divisor of it. This can be significantly accelerated. All you need to do is find a pattern in these digits is some numerical system.

However, to be certain that a number 'value' is prime, you must check whether it is divisible by all prime numbers smaller than ‘value/2’.

  • Author
3 hours ago, Sensei said:

a*b*c = d

a*b*c*5 = d*5

Sensei, thanks for the descriptive post. It will take me some time to respond. Remember I am filled with abstract thoughts. Here I will share very simply my thought process.

Simply stated there is no a, b, or c. That is the definition of composite. That is just to describe composites. Only if you didn’t know they weren’t composite would you multiply a arbitrary Prime (5)

d stands alone just as numbers increase new Primes appear. So d times Prime equals a semiPrime.

So if I know the range of numbers I wanted which I confirm they are Prime by creating a semiPrime.

4 hours ago, Sensei said:

But you don't know which numbers are primes, smaller than ‘value’... Unless you create a database.. Reading from the database will take up a lot of processor time

I am avoiding the database by selecting a designated range I believe the Prime factor is.

Then I take my arbitrary well known Prime of 5 and multiply it by all odd numbers in my designated range. The only numbers that are semiPrime end in 5. Some numbers may be composite but I don’t care I have just decreased my sample size.

Only database needed is to store the numbers that when multiplied by 5 end in 5.

  • Author

Here is my code to find the range. It is a script I wrote in Mathematica. This is how I find the designated range that I want to multiply the odd numbers by 5. It is linked to above where it is derived.

Clear[x, y, g, pnp]

pnp = 2211282552952966643528108525502623092761208950247001539441374831\
912882294140\
   2001986512729726569746599085900330031400051170742204560859276357953\
757185954\
   2988389587092292384910067030341246205457845664136645406842143612930\
176940208\
   46391065875914794251435144458199;

x = 1.13056560621865239372901234269585839625544`15.653559774527023*^100

y = (((pnp^2/x) + x^2)/pnp)

g = x*y

N[y]



Out[75]= 1.130565606218652*10^100

Out[76]= 1.955908211597676*10^159

Out[77]= 2.211282552952967*10^259

Out[78]= 1.95591*10^159
10 hours ago, Trurl said:

Only database needed is to store the numbers that when multiplied by 5 end in 5.

In your example; how many numbers do you need to store?

  • Author
2 hours ago, Ghideon said:

In your example; how many numbers do you need to store?

That is a good question. You could test them in real time.

I mean dividing them into:

pnp = 2211282552952966643528108525502623092761208950247001539441374831\
912882294140\
   2001986512729726569746599085900330031400051170742204560859276357953\
757185954\
   2988389587092292384910067030341246205457845664136645406842143612930\
176940208\
   46391065875914794251435144458199;

Should be close to:

1.130565606218652*10^100

Though it might be worth the effort to store the numbers that were multiplied by 5 to make it easier and have a list of Primes.

Sensei volunteered to be lead programmer.🤪

1 hour ago, Trurl said:

That is a good question. You could test them in real time.

So you do not know? Not even a rough estimate?

1 hour ago, Trurl said:
22112825529529666435281085

RSA-260?

Edited by Ghideon

On 9/17/2025 at 7:08 PM, studiot said:

You could of course see if Euclid's method for finding the HCF can be combined with your proposal, to find factors, as it already seems to be a modification of it.

I know of Euclid's method and its use in cryptography; I got curious since I don't see an obvious connection to trurl's approach ("multiplying by 5"). Can you elaborate on the relation to Euclid's method?

Please sign in to comment

You will be able to leave a comment after signing in

Sign In Now

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.