The Museum of HP Calculators

HP Forum Archive 13

 Improvement on HP-45.Message #1 Posted by r. d. bärtschiger. on 24 Sept 2003, 7:06 p.m. Something just occured to me and in case no one else has thought of this, I thought I would post this and see if there are any responses. On page 7 of the HP-45 owner's Handbook there is an example of what a child prodigy can do. In this case calculate 365365365365365365 squared. It was stated that he was able to do this calculation in just under one minute. Well, I just tried this on my HP-49G+ in exact mode and in about one second it returned the answer, and it is the same as the one given in the book. rdb.

 Re: Improvement on HP-45.Message #2 Posted by Valentin Albillo on 25 Sept 2003, 5:39 a.m.,in response to message #1 by r. d. bärtschiger. Perhaps this particular problem is not that difficult for a math-type prodigy, because of its 'regularity'. I would proceed like this: ```365365365365365365^2 = (365 * 1001001001001001)^2 = 365^2 * 1002003004005006005004003002001 ``` Now, 365^2 can be computed 'in the head' very fast using the well´known trick for squaring numbers ending in 5, namely: ``` [N]5 ^ 2 = [N^2+N]25 (e.g.: 45^2 = [4^2+4]25 = [16+4]25 = 2025) ``` so 365^2 is computed like this: ``` [36^2+36]25 = [1296+36]25 = 133225 ``` at once, requiring only the trivial addition of 36 to the memorized value of 36 squared (any math prodigy worth his/her salt has all squares up to 100^2 perfectly memorized, at the very least). This being accomplished in a second or so, the prodigy must now compute: ``` 133225 * 1002003004005006005004003002001 ``` but this is much easier to do than it seems, because 133225 is such a small, 6-digit value, and the other factor has only 6 different non-zero digits, arranged in such a regular fashion. The prodigy just needs to form the following 6 partial products: ``` 133225 * 1, 133225 * 2, ... , 133225 * 6 ``` but they are trivially formed by simply starting with 133225, then keep on adding 133225 to the previous result five times: ``` 133225, 266450, ... , 799350. ``` Thus, all six of them can be computed mentally in a few seconds at most. Now, it's just simply a matter of arranging them properly for the sum, like this: ``` 133225 266450 ..... ..... 266450 133225 ------------------------------------- 133491850208566925016658299941583225 ``` and that's it. It's actually much easier (for even a mild prodigy) than it seems at first, and most readers of this forum would be able to accomplish it rather easily with a little training. As you have seen, it has little to do with actual complicated computation but with arranging things properly and doing a few sums of small, 6-digit numbers. Only the final result is really multi-digit. Best regards from V.

 Re: Improvement on HP-45.Message #3 Posted by Patrick on 25 Sept 2003, 4:10 p.m.,in response to message #2 by Valentin Albillo So, Valentin, why is it that you collect calculators again? ;-)

 Re: Improvement on HP-45.Message #4 Posted by Valentin Albillo on 26 Sept 2003, 4:36 a.m.,in response to message #3 by Patrick Patrick wrote: "So, Valentin, why is it that you collect calculators again?" Well, you know, they are essentially "toys" for me. I don't have real-life uses for them, save occasional trivial arithmetic, but I find it challenging to explore their programming capabilities and overcome their limitations. I specially like writing unusual programs and composing 'challenges', then write an article or two about it all to share with other likeminded people, such as yourself. But one thing I don't do is "HP chauvinism". If some calculator is good, then it's good, be it HP, Sharp, Casio, TI, whatever. The 'fundamentalistic' approach of "If it's an HP then it's good (regardless of whether it obviously stinks) and if it isn't an HP then it's junk (regardless of it being a far superior machine)" just doesn't cut it here. Best regards from V.

 Programming funMessage #5 Posted by Patrick on 26 Sept 2003, 4:17 p.m.,in response to message #4 by Valentin Albillo Yes, Valentin, I applaud your attitude, even if I sometimes have trouble in exercising it myself. My first HP, that wonderful little HP-25 I bought way back in 1977, permanently polluted my view on life. That machine was so amazing for its day, so well engineered, so comfortable to use, and so challenging to use to its limits, that HP made something of a devoted little kitten out of me. Oh, the shame of it. I share your love of exploring the programmatics of these machines. In fact, it is the real reason I became a collector. I have very few non-programmable machines in my collection (of course, HP made relatively few of them if you look back in history). Right now, for instance, I'm working on a version of the SOLVE function for the HP-11C (only, what... 20 years too late?!). I am trying to be as faithful as I can to the original algorithm described by William H. Kahan in his December 1979 article in the HP Journal. Obviously, it is a challenge to fit such a sophisticated algorithm into the rather limited resources of an 11C, but for me that is the fun of it. I have a working version that implements most, but not all, of the secant method refinements described in the article. However, I am not yet happy with. It currently leaves only 39 program steps for the definition of the function to SOLVE, and is somewhat arcane in its implementation (a result of trying to squeeze the code, I think). Perhaps once I'm more happy with it, I'll follow your lead and submit an article to HPCC. Best regards, Patrick

 Re: Improvement on HP-45.Message #6 Posted by Andrés C. Rodríguez (Argentina) on 27 Sept 2003, 3:45 p.m.,in response to message #2 by Valentin Albillo Valentín, I would certainly attend any math course taught by you. Thank you for an interesting and insightful posting!

 [OT] Re: Improvement on HP-45.Message #7 Posted by Valentin Albillo on 28 Sept 2003, 7:12 p.m.,in response to message #6 by Andrés C. Rodríguez (Argentina) You're welcome, Andres, thanks for your kind words and best regards from V.

 Re: "Exact Mode"Message #8 Posted by Paul Brogger on 25 Sept 2003, 5:31 p.m.,in response to message #1 by r. d. bärtschiger. I've heard much about this "exact mode" recently -- mostly in connection with HP-49G/G+ and the TI-89/V-200. Would someone offer a quick explanation of it, its limits on those calculators (if indeed those all do make it available), and whether any other calculators offer it? Thanks.

 Re: "Exact Mode"Message #9 Posted by R Lion on 25 Sept 2003, 5:57 p.m.,in response to message #8 by Paul Brogger 2 ENTER 4 / gives 0.5 in aprox. mode but 1/2 in exact mode. 48 with Erable, 49G and 49G+ offer these two ways. (I don't know about the 39&40) Raul

 Re: "Exact Mode"Message #10 Posted by Paul Brogger on 25 Sept 2003, 6:27 p.m.,in response to message #9 by R Lion I'm interested in playing with prime factorizations of llllllllaaaaaaaaarrrrgggggeeeee numbers, and it would appear that "exact mode" supports manipulation of quite long integers. Does any one know how long? I'll look into the Erable documentation -- thanks for that!

 Re: "Exact Mode"Message #11 Posted by Giiiii on 25 Sept 2003, 6:35 p.m.,in response to message #10 by Paul Brogger Exact mode works like said before, 1/2 instead of 0.5, 1/3 instead of 0.333333333... But it can work with incredibly long integers (its sort of different with floats. For example, 100!*100! can be calculated VERY quickly. I guess that the size of the integer nmbers you can work with are limited only by memory and time. (Just a guess)

 Re: "Exact Mode"Message #12 Posted by Werner Huysegoms on 26 Sept 2003, 2:13 a.m.,in response to message #10 by Paul Brogger 'Long integers' are limited by available memory only. Whether you're in exact mode or approx makes no difference: arithmetic with long integers returns exact answers. When you're in approx mode, you can't enter an integer directly, it will always be entered as a real (with a decimal point following). Werner

 Re: "Exact Mode"Message #13 Posted by Julián Miranda (Spain) on 29 Sept 2003, 4:06 a.m.,in response to message #9 by R Lion The HP40G will work in "Exact Mode" if you're using the CAS. You can calculate 1000!, for example, it takes around a minute but you have all its digits.

 Re: "Exact Mode"Message #14 Posted by dbrunell on 25 Sept 2003, 6:45 p.m.,in response to message #8 by Paul Brogger On the TI-89/92/200, the limit for exact mode is a little over 600 digits. However, if you have an expression like 1000!, it will carry it around as an unevaluated (but exact) factorial.

Go back to the main exhibit hall