| View previous topic :: View next topic   | 
	
	
	
		| Author | 
		Message | 
	
	
		k1ll3rdr4g0n -
 
  Joined: 04 Jul 2004 Posts: 609
 
  | 
		
			
				 Posted: Sun Dec 05, 2004 4:00 pm    Post subject: Facotring a large number | 
				      | 
			 
			
				
  | 
			 
			
				How would i go about facotrings a large number like:
 
 
31074182404900437213507500358885679300373460228427
 
27545720161948823206440518081504556346829671723286
 
78243791627283803341547107310850191954852900733772
 
4822783525742386454014691736602477652346609
 
 
i dont need someone to tell me the acctual factors just a jump start. Because i thought it was divisible by 3, it wasnt i thought it was divisible by 7, and it wasnt. I would want to almost say its divible by 9, but 9 isnt prime.
 
 
anyone help please? :( _________________
   | 
			 
		  | 
	
	
		| Back to top | 
		
			           | 
		
	
	
		  | 
	
	
		needforspeed -
 
  Joined: 20 Oct 2003 Posts: 69 Location: Kansas
  | 
		
			
				 Posted: Sun Dec 26, 2004 6:26 pm    Post subject:  | 
				      | 
			 
			
				
  | 
			 
			
				do you want to find the Prime factorization?
 
 
Here's psuedocode for a simple algorithm to compute the prime factorization of a number:
 
 	  | Code: | 	 		  
 
Algorithm:
 
i = 2;
 
starting at i, find smallest prime p ≤  n  ∋ pn, do
 
    if found
 
       then // n = pq, q is the quotient
 
       n = q;
 
       i = p
 
       output p;
 
     endif;
 
 | 	  
 
 
Here's psuedocode for The Sieve of Eratosthenes, a better algorithm.
 
 
 	  | Code: | 	 		  
 
construct a table of integers from 2 to n;
 
i = 2;
 
while i ≤ √n
 
   remove all multiples of i, except i, from the table;
 
   starting from i, scan the table to find
 
       the first integer j remaining;
 
    if found
 
       then i = j
 
      else stop (and return)
 
    endif
 
endwhile;
 
 | 	  
 
 
I copied these algorithms directly from my notes from a few semesters ago. _________________ My site and forums | 
			 
		  | 
	
	
		| Back to top | 
		
			            | 
		
	
	
		  | 
	
	
		k1ll3rdr4g0n -
 
  Joined: 04 Jul 2004 Posts: 609
 
  | 
		
			
				 Posted: Tue Dec 28, 2004 10:07 pm    Post subject:  | 
				      | 
			 
			
				
  | 
			 
			
				Thank you but your a little late I found the The Sieve of Eratosthenes at mathworld.wolfram.com/SieveofEratosthenes.html and Ive been working on it ever since :). You can view pic of my progress here http://www.theunderground.ath.cx/images/prime_project/ . Wanna help me work on this xD? _________________
   | 
			 
		  | 
	
	
		| Back to top | 
		
			           | 
		
	
	
		  | 
	
	
		needforspeed -
 
  Joined: 20 Oct 2003 Posts: 69 Location: Kansas
  | 
		
			
				 Posted: Thu Jan 06, 2005 12:44 am    Post subject:  | 
				      | 
			 
			
				
  | 
			 
			
				what exactly are you trying to do anyway? _________________ My site and forums | 
			 
		  | 
	
	
		| Back to top | 
		
			            | 
		
	
	
		  | 
	
	
		 |