Finding prime factors on a "non-programmable" calculator « Next Oldest | Next Newest »

 ▼ Don Shepherd Unregistered Posts: 1,392 Threads: 142 Joined: Jun 2007 09-04-2011, 07:13 PM Article describing a new approach to finding prime factors on the "non-programmable" HP-17bii. ▼ M. Joury Unregistered Posts: 756 Threads: 31 Joined: Aug 2010 09-04-2011, 07:38 PM Thanks Don! I am continuously learning more about the power of the 17b solver! Cheers, -Marwan Lode Unregistered Posts: 101 Threads: 11 Joined: Jun 2011 09-04-2011, 08:04 PM Hey, how long does it take to do the same example (6,469,693,230) for each of the factors for which the time in minutes was given for the non optimized version? ▼ Don Shepherd Unregistered Posts: 1,392 Threads: 142 Joined: Jun 2007 09-04-2011, 08:18 PM Here are the timings, in seconds, for the old version from the Tech. Applications manual, and my version: ``` factor old version new version ------------------------------------ 2 2 2 3 2 2 5 2 2 7 2 2 11 105 2 13 33 2 17 10 2 19 4 2 23 2 2 29 2 2 ``` Don Shepherd Unregistered Posts: 1,392 Threads: 142 Joined: Jun 2007 09-04-2011, 10:08 PM After posting the article, I had to make a change. I thought I could adjust variable TF (beginning trial factor) to the current factor and avoid going back to trial factor 3 each time, but I forgot that the Technical Applications manual states on page 25: Quote: Any attempt to alter the values of the (loop control variables) using the LET function causes the solver to create separate variables of the same name. Therefore, the loop to find factors must always start at 3, the beginning value of the loop control value cannot be adjusted when a factor is found. ▼ Don Shepherd Unregistered Posts: 1,392 Threads: 142 Joined: Jun 2007 09-05-2011, 08:25 AM Actually, the original version does work because what you can't do is modify any of the loop control variables from within the loop in an attempt to end the loop early, because the real loop control values are inaccessible to the user while within the loop. But the modified version of the program is preferable because (a) you don't have to press INIT before each execution, and (b) starting the loop for trial factors at 3 each time does not significantly increase the run time since n (and, therefore, (n)) is adjusted whenever a factor is found. Allen Unregistered Posts: 562 Threads: 27 Joined: Oct 2006 09-05-2011, 10:11 AM Thanks for the cool article.. You're amazing with the 17b solver!

 Possibly Related Threads… Thread Author Replies Views Last Post HP Prime: problem with the memory of calculator during the debug process? Carlos CM (Mexico) 7 3,508 12-06-2013, 12:34 PM Last Post: Carlos CM (Mexico) [WP 34s] Pressure Conversion Factors Timothy Roche 8 3,171 11-04-2013, 07:17 PM Last Post: Dave Shaffer (Arizona) HP Prime: Conversion factors Paul Townsend (UK) 19 5,030 08-27-2013, 09:19 AM Last Post: Nigel J Dowrick who uses programmable calculators? John Ioannidis 24 6,464 06-18-2013, 04:11 PM Last Post: Steve Simpkin HP85 Programmable ROM cardtridge 82929A-service ROM not working- inaki 2 1,887 04-25-2013, 08:08 AM Last Post: inaki HP Prime : new graphing calculator ?! Mic 15 6,361 04-02-2013, 02:54 PM Last Post: critor Finding the largest prime factor on the 15c Evan Gates 2 1,259 10-03-2012, 11:17 AM Last Post: Thomas Klemm TI Programmable 88 - What we missed... Joerg Woerner 22 5,727 03-08-2012, 12:08 AM Last Post: David Ramsey Local variables in RPN programmable? David Hayden 19 4,705 10-28-2011, 03:57 AM Last Post: Marcus von Cube, Germany Finding extremums of function with complex derivate Lukas K. 7 2,331 10-17-2011, 06:06 AM Last Post: bunuel66

Forum Jump: