You seem to be wanting the least common multiple, not a "lowerest [sic]
common factor".
In which case,
\<< \<< LCM \>> STREAM \>>
is about as good as you are likely to get.
LCM finds the least common multiple of two numbers, and STREAM makes it
work on a list.
--------
I think the other replies have shown how to DO this using the HP calc.
But I find myself wondering whether you were really after the algorithm
by which the problem is solved?
Lance
thanx for considering this...
because i have an ancient ( the old good kind ) HP48gx,
and it doesn't have the built in ( ? ) function LCM or STREAM...!
What is the logic/thinking behind these functions...???
thanx!
For a GCF (greatest common factor) program, you can use
\<< WHILE DUP REPEAT SWAP OVER MOD END DROP ABS \>>
though IIRC, there is a built in hp48g command, GCD, which does the same
thing.
For a LCM (least common multiple) program use
\<< DUP2 * ROT ROT GCD / \>>
or substitute the above GCF program for the GCD in this program.
Then for LCM of a list ( of at least 2 numbers) use
\<< LIST\-> 2 OVER START LCM NEXT \>>
The 48 does not contain a GCD command, the 49 does. well except for the
48GII, which is really a 49 in disguise.
Cheers, Werner
> I have an ancient (the old good kind) HP48gx,
> and it doesn't have the built in (?) function LCM or STREAM...!
The HP48G[X] has STREAM (a list processing command),
but neither GCD nor LCM.
Here are some old GCD programs for HP48, plus an interesting challenge:
(note that Werner Huysegoms usually produces the best programs :)
For LCM you can use DUP2 GCD / * [as Werner also said]
How about for fractions?
http://groups-beta.google.com/group/comp.sys.hp48/browse_frm/thread/b970d3d39628af5b/795fc1a4f89e2433#795fc1a4f89e2433
[r->] [OFF]