Hi, Bernd Grubert,
Gilles and
Massimo Gnerucci:
(04-20-2019 10:47 AM)Bernd Grubert Wrote: [ -> ]Here is my solution to Tier 2. It is 192 bytes long, due to the lack of prime number checking and the remainder function on the HP-15C. [...] I have done the test runs on the HP-15C emulator on a PC, since the processing time on my DM-15L is far too long... Since the largest integer number the HP-15C can exactly represent is 9,999,999,999. , this implementation of the Miller-Rabin algorithm can check only number up to 99,999. Due to memory limitations, on the real HP-15C and the DM 15L the longest sequence is 26 values. [...] For base 31 I got the sequence: 619, 18257, ...,(I stopped at 34139 after ~90 min., because I didn't want to wait any longer) [...] For base 7 I got the sequence: 4801, ...,(I stopped at 23451 after ~60 min.) [...] I have attached an HTML-documentation and a txt-file, that can be read into the emulator after changing the extension back to ".15c"
Thanks a lot for your interest and for your nice solution,
Bernd, much appreciated !
Matter of fact, I do appreciate your solution over any purported "solutions" written in non-HP calc languages/environments, such as
Mathematica,
Lua and
Python, which I expressly said in my OP that
should not be used at all but that
certain individual who routinely disregards the rules did nevertheless use, as I discuss below.
You, on the other hand, did abide by the rules and took the trouble to use an actual
HP calculator (or emulator) and wote actual
RPN code, fearlessly wrestling with its limitations, to produce an actual solution to the challenge I posted, instead of going the lazy route of using high-level languages on a full-fledged PC, which lacks any merit whatsoever and which for me amounts to
trolling.
So, again,
Bernd, thank you very much for your valuable contribution, my challenges are created for people like you who work hard on them to produce solutions
under the constraints given, thus fulfilling my stated
purpose, which is to have people using their
HP calculators, with their limitations and warts and all,
not using some fancy non-HP languages and/or environments, which completely defeats the purpose.
(04-21-2019 07:06 AM)Gilles Wrote: [ -> ]Tier 1: Here is my solution without reading others responses. I image that there exists better way. This one is "bestial" ;D Always impressed how fast NewRPL is. Brutal force :
1/ HP50g NewRPL or RPL [...] Solved in only 1.3s in newRPL (on my PC) , 116s with HP50g hdw, much much slower in 779s in RPL (on my PC with Emu48). NewRPL 600 times faster in this case on a PC. [...] 2/ HP50g RPL with ListExt, shorter but slower [...]
Thanks a lot for your
RPL/New
RPL solutions,
Gilles, much appreciated. What I told
Bernd above also applies equally to you so for the sake of brevity I won't repeat it here.
Again, thanks for your interest and for your time, hope you enjoyed the challenge as I certainly enjoyed your solutions, keep them coming for future ones !
(04-24-2019 05:36 AM)Massimo Gnerucci Wrote: [ -> ] (04-23-2019 04:59 PM)Albert Chan Wrote: [ -> ]Switched to Python to extend search range. As expected, Python code is even shorter.
Hi Albert, really interesting (and a little beyond my skills), as usual, but wasn't this one of Valentin's rules?
(03-21-2019 02:08 AM)Valentin Albillo Wrote: [ -> ]Using anything other than a physical or emulated HP calculator is strictly disallowed. Also no VBA, Excel. Pascal, C/C#/C++, Java, Python, Haskell, etc. code, please go elsewhere for that. You must write your code in a language supported in some HP calc (i.e.: RPN, RPL, 71B BASIC/FORTH, etc).
Thanks for pointing this out,
Massimo, I didn't read Mr. Chan's posts because I've placed him in my
Ignore list so that I don't read his post anymore, as he has shown an utter
disregard for the rules I so clearly state in my challenges, thus completely
defeating the purpose and probably ruining them for others, which I find profoundly
disrespectful.
To wit:
- The purpose of my challenges is to offer HP-fan fellow readers the opportunity to actually get to use their HP calculators and their languages to solve allegedly interesting math topics, so that perhaps we all learn some new exciting math facts and some worthwhile HP-calc programming techniques which are cleverly used to overcome the natural limitations of our beloved HP calcs and their languages. Nothing more and nothing else.
If some disrespectful individual like Mr. Chan then goes on and
completely ignores the requirement to use HP calcs and their languages (
RPN,
RPL,
71BASIC,
71FORTH,
PPL,
Saturn assembler, etc) and uses instead
exclusively such software as
Mathematica,
Lua,
Python or whatever on a PC to effortlessly overcome the aforementioned natural limitations of our calcs and provide almost-instant solutions, then:
- No HP calcs/languages are used at all, which completely defeats the intended purpose.
- No HP calcs/languages limitations are overcome at all, with was the idea, as the challenges' difficulty is geared to HP calc/languages, not to Mathematica/Lua/Python running on a PC where the difficulty and inconvenience are diminished by orders of magnitude, which amounts to shameful cheating.
- No HP calcs/languages' new interesting programming techniques are created for everyone to learn, which again completely defeats the intended purpose.
So, what this individual, Mr. Chan, is continuously doing amounts to:
- Utter disrespect to the rules I explicitly stated, which aren't arbitrary but do have the explicit intended purposes stated above.
- Shameful cheating, as he is using software/harware orders of magnitude more powerful that the intended one, namely HP calcs/languages.
- Spoiling, as he gives lots of versions and explicit solutions with no "spoilers" warnings whatsoever, thus spoiling the fun for any rule-abiding forum readers, and probably discouraging them from even attempting the challenge using their HP calculators.
- Trolling, as he has done this any number of times by now. He did that with my cin(x) challenge, for example, and with all the recent ones. He does it all the time though he could certainly go on and post his Mathematica/Lua/Python code in Mathematica/Lua/Python forums (as he did with my Cin(x) challenge; but he nevertheless posted his Lua or Python code here as well).
In one of my challenges he said something to the effect that he only has an
HP-12C at hand but that is hardly a valid excuse as he's obviously using a PC or other device to run his
Mathematica/
Lua/
Python code and there are any number of
free emulators of HP calcs available for Windows,
Mac,
Android and
iOS, such as
Free42,
V41,
Emu71/DOS,
Emu71/Win,
HP-25, most
RPL models,
Prime, etc. etc., which he could easily use but he
doesn't.
This being so, I've placed Mr. Chan in my Ignore list and won't read or comment on his solutions. I'm totally fed up with his continued cheating, trolling and disrespect.
If he's so keen on showing off his abilities he should go and post his
Lua marvels in the
Lua forums and his
Python achievements in the
Python forums, not in my challenge threads, or at the very least be an sportman and provide
first an acceptable solution using HP calcs/languages, as per the rules. At any rate, if he goes on trolling my challenges here like that, I'll certainly take appropriate measures.
Best regards to all.
V.