Title says it all. Two input 32-bit positive integers m, n >= 2, output gcd(m,n) in prime factorization form.
##Input
Input
Command line args or 1 line of stdin okay, whatever's better for golf.
Output
Single space delimited with exponents (no additional spaces). Output nothing if the inputs are relatively prime.
Examples:
$ ./factorize 96 162
2^1 3^1
$ ./factorize 14 15
$ ./factorize 196 294
2^1 7^2
Rules
- You may not use external resources, math libraries or built-in functions for factorization or GCD. Examples: Java, no
java.lang.Math. ruby, noprime_division, perl, nofactor, etc.
Title says it all. Two input 32-bit positive integers m, n >= 2, output gcd(m,n) in prime factorization form.
##Input
Command line args or 1 line of stdin okay, whatever's better for golf.
Output
Single space delimited with exponents (no additional spaces). Output nothing if the inputs are relatively prime.
Examples:
$ ./factorize 96 162
2^1 3^1
$ ./factorize 14 15
$ ./factorize 196 294
2^1 7^2
Rules
- You may not use external resources, math libraries or built-in functions for factorization or GCD. Examples: Java, no
java.lang.Math. ruby, noprime_division, perl, nofactor, etc.
Title says it all. Two input 32-bit positive integers m, n >= 2, output gcd(m,n) in prime factorization form.
Input
Command line args or 1 line of stdin okay, whatever's better for golf.
Output
Single space delimited with exponents (no additional spaces). Output nothing if the inputs are relatively prime.
Examples:
$ ./factorize 96 162
2^1 3^1
$ ./factorize 14 15
$ ./factorize 196 294
2^1 7^2
Rules
- You may not use external resources, math libraries or built-in functions for factorization or GCD. Examples: Java, no
java.lang.Math. ruby, noprime_division, perl, nofactor, etc.
- 4.7k
- 21
- 25
Title says it all. Two input 32-bit positive integers m, n >= 2, output gcd(m,n) in prime factorization form.
##Input
Command line args or 1 line of stdin okay, whatever's better for golf.
Output
Single space delimited with exponents (no additional spaces). Output nothing if the inputs are relatively prime.
Examples:
$ ./factorize 96 162
2^1 3^1
$ ./factorize 14 15
$ ./factorize 196 294
2^1 7^2
Rules
- You may not use external resources or, math libraries or built-in functions for factorization or GCD. Examples: Java, no
java.lang.Math. ruby, noprime_division, perl, nofactor, etc.
Title says it all. Two input 32-bit positive integers m, n >= 2, output gcd(m,n) in prime factorization form.
##Input
Command line args or 1 line of stdin okay, whatever's better for golf.
Output
Single space delimited with exponents (no additional spaces). Output nothing if the inputs are relatively prime.
Examples:
$ ./factorize 96 162
2^1 3^1
$ ./factorize 14 15
$ ./factorize 196 294
2^1 7^2
Rules
- You may not use external resources or math libraries. Examples: Java, no
java.lang.Math. ruby, noprime_division, perl, nofactor, etc.
Title says it all. Two input 32-bit positive integers m, n >= 2, output gcd(m,n) in prime factorization form.
##Input
Command line args or 1 line of stdin okay, whatever's better for golf.
Output
Single space delimited with exponents (no additional spaces). Output nothing if the inputs are relatively prime.
Examples:
$ ./factorize 96 162
2^1 3^1
$ ./factorize 14 15
$ ./factorize 196 294
2^1 7^2
Rules
- You may not use external resources, math libraries or built-in functions for factorization or GCD. Examples: Java, no
java.lang.Math. ruby, noprime_division, perl, nofactor, etc.
- 4.8k
- 1
- 22
- 49
Title says it all. Two input 32-bit positive integers m, n >= 2, output gcd(m,n) in prime factorization form.
##Input
Command line args or 1 line of stdin okay, whatever's better for golf.
Output
SpaceSingle space delimited with exponents (no additional spaces). Output nothing if the inputs are relatively prime.
Examples:
$ ./factorize 96 162
2^1 3^1
$ ./factorize 14 15
$ ./factorize 196 294
2^1 7^2
Rules
- You may not use external resources or math libraries. Examples: Java, no
java.lang.Math. ruby, noprime_division, perl, nofactor, etc.
Title says it all. Two input 32-bit positive integers m, n >= 2, output gcd(m,n) in prime factorization form.
##Input
Command line args or 1 line of stdin okay, whatever's better for golf.
Output
Space delimited with exponents. Output nothing if the inputs are relatively prime.
Examples:
$ ./factorize 96 162
2^1 3^1
$ ./factorize 14 15
$ ./factorize 196 294
2^1 7^2
Rules
- You may not use external resources or math libraries. Examples: Java, no
java.lang.Math. ruby, noprime_division, perl, nofactor, etc.
Title says it all. Two input 32-bit positive integers m, n >= 2, output gcd(m,n) in prime factorization form.
##Input
Command line args or 1 line of stdin okay, whatever's better for golf.
Output
Single space delimited with exponents (no additional spaces). Output nothing if the inputs are relatively prime.
Examples:
$ ./factorize 96 162
2^1 3^1
$ ./factorize 14 15
$ ./factorize 196 294
2^1 7^2
Rules
- You may not use external resources or math libraries. Examples: Java, no
java.lang.Math. ruby, noprime_division, perl, nofactor, etc.