Tool to decompose in prime factors. In Mathematics, the prime factors decomposition (also known as Prime Integer Factorization) consists in writing a positive integer with a product of prime factors

Prime Factors Decomposition - dCode

Tag(s) : Arithmetics,Mathematics

dCode is free and its tools are a valuable help in games, puzzles and problems to solve every day!

You have a problem, an idea for a project, a specific need and dCode can not (yet) help you? You need custom development? *Contact-me*!

This page is using the new English version of dCode, *please make comments* !

Sponsored ads

This script has been updated, please report any problems.

Tool to decompose in prime factors. In Mathematics, the prime factors decomposition (also known as Prime Integer Factorization) consists in writing a positive integer with a product of prime factors

The decomposition needs to try to divide the number by the whole prime factors inferior to itself. dCode allows 1000-digits numbers but will stop the calculation if too long.

123456 = 2^6 × 3 × 643

It exists several algorithms : classical iterative division, Pollard rho algorithm, elliptic curves, and the quadratic sieve algorithm. dCode uses a combination of all them to be very fast.

To know if a number is prime, it need to check if it has any divisor except 1 or itself, this test is called a primality test. dCode allows 10000 digits numbers.

It exists several test to know if a number is a prime number : Miller–Rabin or Lucas-Lehmer are the one used by dCode.

The whole list of prime numbers starts with : 2 3 5 7 11 13 17 19 23 29 31 37 41 43 47 53 59 61 67 71 73 79 83 89 97 101 103 107 109 113 127 131 137 139 149 151 157 163 167 173 179 181 191 193 197 199 211 223 227 229 233 239 241 251 257 263 269 271 277 281 283 293 307 311 313 317 331 337 347 349 353 359 367 373 379 383 389 397 401 409 419 421 431 433 439 443 449 457 461 463 467 479 487 491 499 503 509 521 523 541 547 557 563 569 571 577 587 593 599 601 607 613 617 619 631 641 643 647 653 659 661 673 677 683 691 701 709 719 727 733 739 743 751 757 761 769 773 787 797 809 811 821 823 827 829 839 853 857 859 863 877 881 883 887 907 911 919 929 937 941 947 953 967 971 977 983 991 997... and there are an infinite number of primes.

The demonstration of the infinity of prime numbers is : Let P be a prime number and P# the Primorial of P : the product of 2x3x5x......xP of all the prime numbers between 2 and P. Let Q = P#+1, then, the rest of the euclidean division of Q by any prime number inferior to P will be 1. So, all prime factors of Q (Q can be prime) are prime numbers superior to P. It will always exists prime numbers superiors to P

`// javascript`

function prime_factors(n) {

if (!n || n < 2)

return [];

var f = [];

for (var i = 2; i <= n; i++){

while (n % i === 0){

f.push(i);

n /= i;

}

}

return f;

};

dCode retains ownership of the source code of the script Prime Factors Decomposition. Except explicit open source licence (free / freeware), any algorithm, applet, software (converter, solver, encryption / decryption, encoding / decoding, ciphering / deciphering, translator), or any snippet or function (convert, solve, decrypt, encrypt, decipher, cipher, decode, code, translate) written in PHP (or Java, C#, Python, Javascript, etc.) which dCode owns rights can be transferred after sales quote. So if you need to download the Prime Factors Decomposition script for offline use, for you, your company or association, see you on contact page !

- How to decompose a number in a series of prime factors?
- What are algorithms allowing to decompose in prime factors?
- How to know if a number is a prime?
- What are primality tests algorithms?
- Is there a list of prime numbers?
- How to demonstrate that it exist an infinite number of primes?
- How to code a prime factor decomposition?

prime,factor,decomposition,factorization,factorize,elliptic,product,2,3,5,7,11

Source : http://www.dcode.fr/prime-factors-decomposition

© 2016 dCode — The ultimate 'toolkit' website to solve every problem. dCode