Community Documents

cancel
Showing results for 
Search instead for 
Did you mean: 

An new combination number decomposition method

 Hi 

  I am a Personal researcher who likes to use modern tools for research. Fast retrieval, computer means and  computing tools, the NI LabVIEW application in this process and the transfer of complete thinking have improved the efficiency. This has helped people achieve pragmatic and efficient goals. So I chose this source document to share in the NI Forum.
NI LabVIEW program provides me with intuitive and convenient construction for completing this program construction, and can start testing immediately when the idea appears. and continuously adjusts to a self-consistent state. Avoid excessive time expenditure and get work results more effectively.I will be happy to present these findings here.
VI Examples for testing can be found in the attachment.
 

This method gives the simplest inverse calculation method available. so as to give the way of checking prime numbers in computer machine calculus.

Generally, for decomposition, only odd numbers within sqrt ( M ) need to be determined, so the computational complexity can also be greatly reduced.

Obviously, you also have better ways to improve the details.

The following is a process note, which can be directly transferred. It uses one loop to complete the decomposition of multiple prime numbers ( if any ) in a composite number )

We have a large number B and need to decompose its prime factor

1,     First, it is determined whether the large number can be squared.

If you can't square into the [for loop], the loop of times is the size of a large number B.

2,     Set a counter p ( for P = 1,B, P + + )

3,     Let [ B ]and[ p ] each time to get the number N = B /P, and judge whether the [N] is an integer or float.

4,     If B can be divided exactly, set a counter J to clear and then J to add 1

5,     If J is 1

Then use the division result [N] of division the above large number to check the end and deterNine if N is odd, if odd,J + 1

6,     Judge whether the end of P+ N is even, if even, J + 1

7,     If j = 3 and I > 1, then stop loop, output .

8,     Count Arrived, Stop Cycle

 

We can find the [P] and [N] varian is prime number.

(B/P)mod 2=((N+P)mod 2 )+1

You can also find the formula in the doc file.

Contributors