mersenneforum.org  

Go Back   mersenneforum.org > Extra Stuff > Miscellaneous Math

Reply
 
Thread Tools
Old 2011-07-05, 00:30   #12
cheesehead
 
cheesehead's Avatar
 
"Richard B. Woods"
Aug 2002
Wisconsin USA

170148 Posts
Default

"Trial factoring" is not the only, and may not be the most common, name for this method outside the GIMPS community.

Wolfram Mathworld (http://mathworld.wolfram.com/) lists "Direct Search Factorization" (http://mathworld.wolfram.com/DirectS...orization.html) and "Trial Division" (http://mathworld.wolfram.com/TrialDivision.html) as names for the method we know as Trial Factoring.
cheesehead is offline   Reply With Quote
Old 2011-07-05, 06:32   #13
JohnFullspeed
 
May 2011
France

7·23 Posts
Default TF

If you want to factorize a number n you have to divide the n by all the primes smaller than √n
So if you compute the primes until 32 bits (200 000 000):(1 second with YAKU )you can factorize 10^20.
directly.

After it's easy
Let Prime be the list of prime until 32bits
and FP the list of the primes factors

R:=
√n
I:=1;
C:=0;
repeat
while n mod
Prime[i]=0 do
b
egin
C:= C+1;
PF
[C]:= Prime[i]; // save thr factor
n:- n div Prime[i]; // new value to factorize
R:= √n; // new limit for searching
end
I:= I+1;
until Prime[i]> R

It is today the faster method : Let m be the time is how div my computer do in 1 second and if n is prime and 10^19 you need 200 000 000 / m secondes
the problem is just the memory configuration; the Prime list is 770 Mo so you need 1Giga.
but today all computers have more than 1 G of RAM
and it easy to use less.
John




JohnFullspeed is offline   Reply With Quote
Old 2011-07-05, 11:57   #14
Mini-Geek
Account Deleted
 
Mini-Geek's Avatar
 
"Tim Sorbera"
Aug 2006
San Antonio, TX USA

17·251 Posts
Default

Quote:
Originally Posted by JohnFullspeed View Post
If you want to factorize a number n you have to divide the n by all the primes smaller than √n
http://en.wikipedia.org/wiki/Integer_factorization
Mini-Geek is offline   Reply With Quote
Old 2011-07-05, 12:22   #15
R. Gerbicz
 
R. Gerbicz's Avatar
 
"Robert Gerbicz"
Oct 2005
Hungary

5CC16 Posts
Default

Quote:
Originally Posted by JohnFullspeed View Post
If you want to factorize a number n you have to divide the n by all the primes smaller than √n
...(1 second with YAKU )
Your method is broken for n=4.
What is YAKU?
R. Gerbicz is offline   Reply With Quote
Old 2011-07-05, 16:02   #16
JohnFullspeed
 
May 2011
France

7·23 Posts
Default Factor

The method is exactly given by WiKi
for big factor we use a quadratic Sieve for small
factors division


A question

You use 2 power so how do you ytest tha a value n is a 2 power?
for example 5623852325444865747416 2 power or no?

Thanks

john
JohnFullspeed is offline   Reply With Quote
Old 2011-07-05, 16:20   #17
science_man_88
 
science_man_88's Avatar
 
"Forget I exist"
Jul 2009
Dumbassville

26·131 Posts
Default

Quote:
Originally Posted by JohnFullspeed View Post
The method is exactly given by WiKi
for big factor we use a quadratic Sieve for small
factors division


A question

You use 2 power so how do you ytest tha a value n is a 2 power?
for example 5,623,852,325,444,865,747,416 2 power or no?

Thanks

john
well one note the 6 on the end it can tell me 2 things one it's divisible by 2, and two if it is a power of 2 it's 2^x where x of the form 4y because the end digits go 2,4,8,6,2,4,8,6. the length tells me it would have to be about 72 or 73, 72 is divisible by 4 so it would have to be that if it was. Of course I'm crap at this stuff. also you may realize that 72 is divisible by 6 which means if you sum the digits until you get a number under 9 you'll get 5 if it can be. adding up the digits that way we get 2 so it's not 2^72 and therefore it isn't a power of 2 as we've proven it could only be 2^72 .

Last fiddled with by science_man_88 on 2011-07-05 at 16:23
science_man_88 is offline   Reply With Quote
Old 2011-07-05, 16:24   #18
ldesnogu
 
ldesnogu's Avatar
 
Jan 2008
France

2×52×11 Posts
Default

Quote:
Originally Posted by JohnFullspeed View Post
You use 2 power so how do you ytest tha a value n is a 2 power?
for example 5623852325444865747416 2 power or no?
For n non zero, n is a power of two iff n & (n-1) = 0

Last fiddled with by ldesnogu on 2011-07-05 at 16:25
ldesnogu is offline   Reply With Quote
Old 2011-07-06, 10:07   #19
JohnFullspeed
 
May 2011
France

7·23 Posts
Default Power

Quote:
Originally Posted by ldesnogu View Post
For n non zero, n is a power of two iff n & (n-1) = 0
Thanks to the 2 Canadians. I use an other way but wih ASM so this version is better:I adopt

If BSR(n) = BSL(n)

a 2 power have only one bit set to one so if the offset rigth of the first bit is the same than the left thatmean that you have 1 bit set to 1
More : BSL or BSR give you the power of 2 if you need itt


The version of science_man_88 is interesting It shows the difference inbto a human logc and the computer and whyy mathématician need computer specialist

You say that to know if n is a multiple of 6 the sum of the digitsmust be 5
It'Strue and easy to computefor a humman but for the computer is't very long.
because we work in Base 1 and the computer in BASE 2
so if you fave 123 iis easy to compute 1+2+3=6
But the compuyer have 1111011 it s more difficult to find 1,2,3
so he need to change is base to convert 1111011 in 123 (itoa)
The change is long. It many more faster for the computer to compute the modulo 6 . The mod will 0 is n is a multiple

The computer do if N mod 6=0

The 'human commputer' do
s== atoi(n)
l:= length(s);
G:=0
for i:=1 to L do
G:=G+(S(i)-48);
If G=5... i

the human directly compute 1+2+3 no timùe and compare the result with 5

In fact the speed method is to make the didv 123 /6 and the computer is the speeder. But never your computer understand what it does and knows why. Only thr humman do that. A computer never find how to solve a proble . It just compute always more quickly

John
JohnFullspeed is offline   Reply With Quote
Old 2011-07-06, 10:16   #20
ldesnogu
 
ldesnogu's Avatar
 
Jan 2008
France

10468 Posts
Default

Quote:
Originally Posted by JohnFullspeed View Post
Thanks to the 2 Canadians. I use an other way but wih ASM so this version is better:I adopt

If BSR(n) = BSL(n)

a 2 power have only one bit set to one so if the offset rigth of the first bit is the same than the left thatmean that you have 1 bit set to 1
Did you mean Intel BSF/BSR? If so get ready for being disappointed as these two instruction implementation performance vary wildly depending on the CPU.
ldesnogu is offline   Reply With Quote
Old 2011-07-06, 20:14   #21
JohnFullspeed
 
May 2011
France

2418 Posts
Default BSL

It 's always good to learn
john
JohnFullspeed is offline   Reply With Quote
Old 2011-07-07, 00:50   #22
R.D. Silverman
 
R.D. Silverman's Avatar
 
Nov 2003

22·5·373 Posts
Default

Quote:
Originally Posted by JohnFullspeed View Post
[SIZE=4]If you want to factorize a number n you have to divide the n by all the primes smaller than √n
If you ever bothered to do even minimal reading about factoring methods,
you would quickly learn that you do NOT "have to divide the n by all the primes smaller than √n".

Indeed, algorithms exist that do not do ANY division.

Further, even when using trial division you do not have to divide
by all the primes up to \sqrt n. You divide by 2,3,5, ..... p,
reducing n by each factor found until p^2 is greater than the remaining
cofactor. Trial division quits when the cofactor is prime. Only
when n = p(p+2) does one divide all the way to \sqrt n and this case is handled
in only 1 iteration by Fermat's method
(which requires no division at all!)

Do us all a favor. Drop your arrogance and go away until you have
done some background reading about number theory in general, and
computational number theory in particular. Every time you talk, you
say something grossly wrong.
R.D. Silverman is offline   Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
More Power!!!! petrw1 Teams 10 2019-10-15 17:36
TDP as power used? CRGreathouse Hardware 9 2016-02-06 18:46
How much power am I really using? petrw1 Lounge 19 2013-12-13 13:00
Power??? JohnFullspeed Programming 5 2011-08-30 16:28
IBM Power 6 Unregistered Information & Answers 7 2008-08-30 14:36

All times are UTC. The time now is 02:21.


Sat Jul 17 02:21:44 UTC 2021 up 50 days, 9 mins, 1 user, load averages: 1.36, 1.30, 1.24

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2021, Jelsoft Enterprises Ltd.

This forum has received and complied with 0 (zero) government requests for information.

Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation.
A copy of the license is included in the FAQ.