Hello Math-Fun, does someone know of an on-line factorization applet showing ALL divisors of n (not only the prime ones) Not this applet, for instance : http://www.merriampark.com/factor.htm Neither this famous one : http://www.alpertron.com.ar/ECM.HTM Thanks, Best, É.
Well, here's a program that will generate them for you given the prime factors. Given n factors, for i=0 to 2^n - 1 d = 1 for j=0 to n-1 if bit j of i is set (*) d = d * jth factor end print d end (*) in C, this is if (i & (1<<j)) -- Mike Stay metaweta@gmail.com http://math.ucr.edu/~mike
Only if the number is square free. Else it generates the same factor multiple times. --ms Mike Stay wrote:
Well, here's a program that will generate them for you given the prime factors. Given n factors, for i=0 to 2^n - 1 d = 1 for j=0 to n-1 if bit j of i is set (*) d = d * jth factor end print d end
(*) in C, this is if (i & (1<<j))
Sure, but it gets them all. If you want it to generate only unique ones, then generalize from binary to a variable base, where the base in a given position is the exponent on the corresponding prime. On 7/19/07, Mike Speciner <speciner@ll.mit.edu> wrote:
Only if the number is square free. Else it generates the same factor multiple times.
--ms
Mike Stay wrote:
Well, here's a program that will generate them for you given the prime factors. Given n factors, for i=0 to 2^n - 1 d = 1 for j=0 to n-1 if bit j of i is set (*) d = d * jth factor end print d end
(*) in C, this is if (i & (1<<j))
_______________________________________________ math-fun mailing list math-fun@mailman.xmission.com http://mailman.xmission.com/cgi-bin/mailman/listinfo/math-fun
-- Mike Stay metaweta@gmail.com http://math.ucr.edu/~mike
On Thu, 19 Jul 2007, Eric Angelini wrote:
does someone know of an on-line factorization applet showing ALL divisors of n (not only the prime ones)
Use for example the command Divisors(12345678); at this site http://magma.maths.usyd.edu.au/calc/ and click on evaluate. You will get [ 1, 2, 3, 6, 9, 18, 47, 94, 141, 282, 423, 846, 14593, 29186, 43779, 87558, 131337, 262674, 685871, 1371742, 2057613, 4115226, 6172839, 12345678 ] Total time: 0.350 seconds, Total memory usage: 6.46MB
participants (4)
-
Edwin Clark -
Eric Angelini -
Mike Speciner -
Mike Stay