Factoring Integer into Primes: HP 48GX « Next Oldest | Next Newest »

 ▼ John Ferman Unregistered Posts: 11 Threads: 5 Joined: Jan 2008 12-19-2008, 09:54 PM I have the HP41 PPC ROM which contains a routine for factoring any integer into its prime number factors. I am reverse engineering it to make it run on the HP48GX. But might someone already have done that. Anyone know? ▼ Hal Bitton in Boise Unregistered Posts: 291 Threads: 43 Joined: Jun 2007 12-20-2008, 12:05 AM Hi John, I wrote a prime factor program for my HP67 some time ago. In addition to prime factors, it will give all the primes between two given numbers as well. I'd love to have it on my 48gx, but I'm not that adept at RPL programming. Let me know if you want me to post it. Best regards, Hal ▼ John Mosand Unregistered Posts: 58 Threads: 15 Joined: Mar 2006 12-20-2008, 11:27 AM My HP 48SX came with a factoring prg 'built in', among several other prgs in VAR. It factors a 10 digit number in less than half a sec. It shows automatically how long time it takes. Gerson W. Barbosa Unregistered Posts: 2,761 Threads: 100 Joined: Jul 2005 12-20-2008, 02:32 PM Quote: I am reverse engineering it to make it run on the HP48GX. Joe Horn has done this already: ``` 123456789 RT -> 123456789: { 3 3 3607 3803 } 25.82 seconds (HP-48GX) 5961027250 RT -> 5961027250: { 2 5 5 5 3011 7919} 21.95 seconds %%HP: T(3)A(D)F(,); DIR pf \<< DUP { } SWAP DO NP ROT OVER + ROT ROT / DUP UNTIL 1 == END DROP SWAP \->TAG \>> NP \<< DUP \v/ \-> s \<< DUP IF 2 MOD THEN 3 WHILE DUP2 MOD OVER s < AND REPEAT 2 + END DUP s IF > THEN DROP DUP END ELSE 2 END \>> \>> RT \<< TIME SWAP pf TIME ROT HMS- HMS\-> 3600 * SWAP \>> END ``` I've written a List-to-Algebraic routine that will change { 3 3 3607 3803 } to '3^2*3607*3803'. Gerson. ▼ Hal Bitton in Boise Unregistered Posts: 291 Threads: 43 Joined: Jun 2007 12-20-2008, 03:11 PM Thank you Gerson, I'll key this into my 48gx and try it out. Best regards, hal Hal Bitton in Boise Unregistered Posts: 291 Threads: 43 Joined: Jun 2007 12-20-2008, 11:59 PM I'm trying to key in and run this program, which Gerson Barbosa was kind enough to post, and have a couple of questions. 1. What are all the backslashes? I can't find that character listed in the 48G manual. I'm assuming the forward slashes denote division. 2. Could someone help me decipher this line " \<< DUP \v/ \-> s", in particular the backslashes, and the \v/? My apologies for not being more RPL savvy, but I think I'm not alone in this boat:) Best regards, hal ▼ V-PN Unregistered Posts: 785 Threads: 13 Joined: Jan 2005 12-21-2008, 01:12 AM When you transfer special calculator characters they get automatically replaced by trigraphs (and back)Edited: 21 Dec 2008, 1:15 a.m. ▼ Hal Bitton in Boise Unregistered Posts: 291 Threads: 43 Joined: Jun 2007 12-21-2008, 09:48 AM Thank you V-PN, I see the light!! The program works beautifully now. best regards, hal Gerson W. Barbosa Unregistered Posts: 2,761 Threads: 100 Joined: Jul 2005 12-22-2008, 07:32 AM V-PN has already been of help. Anyway, this is Joe Horn's program and documentation: I've just found my L2A (list to algebraic) program, which I thought resided only in my HP-28S memory, here: An even faster program is presented by Joe Horn himself in message #9, which I hadn't read yet. Thanks, Joe! Regards, Gerson.

 Possibly Related Threads… Thread Author Replies Views Last Post HP Prime vs TI : Factoring ? HP Pioneer 7 2,443 10-29-2013, 02:00 PM Last Post: CompSystems HP Prime: Edit integer in RPN mode plivesey 15 4,958 10-18-2013, 04:34 PM Last Post: kris223 Prime Edit Integer kris223 8 2,649 09-24-2013, 06:43 PM Last Post: kris223 Understanding HP-16C integer division Jimi 18 5,230 10-16-2012, 09:13 PM Last Post: Eddie W. Shore Truncating to Integer & Fraction--HP-35A/21A Matt Agajanian 11 3,074 03-31-2012, 10:36 PM Last Post: Matt Agajanian WP34S x=? in integer mode Harald 8 2,257 03-13-2012, 07:00 PM Last Post: Paul Dale Wp34s beta 2: possible serious bug in integer mode Cristian Arezzini 3 1,296 06-10-2011, 06:01 PM Last Post: Cristian Arezzini wp34s Integer Word Size versus 16C Jake Schwartz 7 2,251 05-06-2011, 02:19 AM Last Post: Walter B Windows 7 and HP 48GX Nico Tak 12 3,476 03-01-2011, 04:02 AM Last Post: Marcus von Cube, Germany HP 48GX Squeaky Anthony (USA) 3 1,559 02-09-2011, 01:15 PM Last Post: Anthony (USA)

Forum Jump: