HP48GX Routine to Extract Prime Number Factors

  • Follow


I have an HP-41C routine out of the PPC ROM book that factors an
integer into prime number factors. I am in the process of reverse
engineering it into HP-48 code, but am curious to know if there might
be a similar routine out in our HP cyber space. Any one know? Thanks.

jwferman@ties2.net
0
Reply Jack 12/12/2008 5:14:09 AM

On Thu, 11 Dec 2008 23:14:09 -0600, Jack wrote:

> I have an HP-41C routine out of the PPC ROM book that factors an
> integer into prime number factors. I am in the process of reverse
> engineering it into HP-48 code, but am curious to know if there might
> be a similar routine out in our HP cyber space.

A UserRPL system:
http://groups.google.com/group/comp.sys.hp48/msg/ff974a031e5baa26?dmode=3D=
source

Many more:
http://www.hpcalc.org/search.php?query=3Dprime+factor&hp48=3D1

One of above, in particular:

"HP 48SX prime factorizer routines
Inspired by HP 41 PPC ROM's 'NP'"
http://www.hpcalc.org/details.php?id=3D1582
(One of Joe Horn's earliest :)

[r->] [OFF]
0
Reply John 12/12/2008 7:02:16 AM


On Dec 11, 11:02=A0pm, "John H Meyers" <jhmey...@nomail.invalid> wrote:
> On Thu, 11 Dec 2008 23:14:09 -0600, Jack wrote:
> > I have an HP-41C routine out of the PPC ROM book that factors an
> > integer into prime number factors. I am in the process of reverse
> > engineering it into HP-48 code, but am curious to know if there might
> > be a similar routine out in our HP cyber space.
>
> A UserRPL system:http://groups.google.com/group/comp.sys.hp48/msg/ff974a0=
31e5baa26?dmo...
>
> Many more:http://www.hpcalc.org/search.php?query=3Dprime+factor&hp48=3D1
>
> One of above, in particular:
>
> "HP 48SX prime factorizer routines
> Inspired by HP 41 PPC ROM's 'NP'"http://www.hpcalc.org/details.php?id=3D1=
582
> (One of Joe Horn's earliest :)
>
> [r->] [OFF]

Is seems obvious to me that coding it in HPGCC is the way to go.

(remember that free advice is sometime worth it.)
0
Reply mjc 12/13/2008 5:11:50 AM

On Fri, 12 Dec 2008 23:11:50 -0600:

> Is seems obvious that coding it in HPGCC is the way to go.

Plus trading in that HP48GX for an HP50G :)

Plus ignoring its built-in factoring command :)
[although it doesn't always work]

If one wants to use a specific exercise just to learn
a specific category of programming
(UserRPL, SysRPL, C, or whatever),
then one also might as well do it
in the environment that one wants to learn.

[r->] [OFF]
0
Reply John 12/13/2008 6:00:45 PM

On Dec 13, 1:00=A0pm, "John H Meyers" <jhmey...@nomail.invalid> wrote:
> Plus ignoring its built-in factoring command :)
> [although it doesn't always work]
>


How so? Is this only when the integer to be factored contains too many
large prime factors? Or are there specific (not so large) numbers that
the built-in command fails at?

S.C.
0
Reply sc_usenet 12/14/2008 2:02:52 AM

On Dec 13, 1:00=A0pm, "John H Meyers" <jhmey...@nomail.invalid> wrote:
> Plus ignoring its built-in factoring command :)
> [although it doesn't always work]
>


Or is that for factoring/collecting polynomials? For instance, the
TI-89 fails to factor

X^6 + 2*X^3 - X^2 + 1

as

(X^3 + X + 1)(X^3 - X + 1)

while the HP succeeds. (and there are probably many other contrived
examples of polynomials, each favoring one machine or the other.)

S.C.
0
Reply sc_usenet 12/14/2008 2:08:59 AM

On Dec 13, 7:02=A0pm, sc_use...@hotmail.com wrote:
> On Dec 13, 1:00=A0pm, "John H Meyers" <jhmey...@nomail.invalid> wrote:
>
> > Plus ignoring its built-in factoring command :)
> > [although it doesn't always work]
>
> How so? Is this only when the integer to be factored contains too many
> large prime factors? Or are there specific (not so large) numbers that
> the built-in command fails at?
>
> S.C.

The 50g FACTOR will timeout and only return a subset of the factors if
the integer is very large, see:

http://www.hpmuseum.org/cgi-sys/cgiwrap/hpmuseum/archv018.cgi?read=3D131384=
#131384

Messages 11 - 18 for an example.

IANS,

Try to factor:  77777777777777777777777777777777777777777777777771

50g FACTOR returns:

89 181 3413 1414655397028665483638860602348991230355163

When the complete factorization is:

89 181 3413 88085341 12586899513131 1275934133688965411653

I used HPGCC3 @ 192Mhz to factor it in about 4 seconds.
0
Reply datajerk 12/14/2008 8:10:08 PM

"#&%#!"#�!
Even my PC emulation gives the 1st answer
I need to upgrade my PC... (=wait till Xmas)
I also need to go to the HPGCC3 (with my new PC)
AND (OT)
I think my Busa needs a turbo :-D
(I have also ordered some pills from the internet...)

<datajerk@gmail.com> wrote in message 
news:ee7c09b4-58ff-4efb-909e-b61976096589@d42g2000prb.googlegroups.com...
On Dec 13, 7:02 pm, sc_use...@hotmail.com wrote:
> On Dec 13, 1:00 pm, "John H Meyers" <jhmey...@nomail.invalid> wrote:
>
> > Plus ignoring its built-in factoring command :)
> > [although it doesn't always work]
>
> How so? Is this only when the integer to be factored contains too many
> large prime factors? Or are there specific (not so large) numbers that
> the built-in command fails at?
>
> S.C.

The 50g FACTOR will timeout and only return a subset of the factors if
the integer is very large, see:

http://www.hpmuseum.org/cgi-sys/cgiwrap/hpmuseum/archv018.cgi?read=131384#131384

Messages 11 - 18 for an example.

IANS,

Try to factor:  77777777777777777777777777777777777777777777777771

50g FACTOR returns:

89 181 3413 1414655397028665483638860602348991230355163

When the complete factorization is:

89 181 3413 88085341 12586899513131 1275934133688965411653

I used HPGCC3 @ 192Mhz to factor it in about 4 seconds. 


0
Reply Veli 12/14/2008 10:18:49 PM

On Dec 14, 5:18=A0pm, "Veli-Pekka Nousiainen"
<velipekka.nousiai...@saunalahti.fi> wrote:
> "#&%#!"#=A4!
> Even my PC emulation gives the 1st answer
> I need to upgrade my PC... (=3Dwait till Xmas)
> I also need to go to the HPGCC3 (with my new PC)


Your PC emulation is probably emulating the timeout also. And if you
have an HP PC, it might be emulating the missed keystrokes too :)

S.C.
0
Reply sc_usenet 12/14/2008 11:08:33 PM

8 Replies
293 Views

(page loaded in 0.114 seconds)

Similiar Articles:







7/27/2012 9:59:52 PM


Reply: