[VA] Short & Sweet Math Challenge #24: "2019 Spring Special 5-tier" - Printable Version +- HP Forums (https://www.hpmuseum.org/forum) +-- Forum: HP Calculators (and very old HP Computers) (/forum-3.html) +--- Forum: General Forum (/forum-4.html) +--- Thread: [VA] Short & Sweet Math Challenge #24: "2019 Spring Special 5-tier" (/thread-12656.html) |
RE: [VA] Short & Sweet Math Challenge #24: "2019 Spring Special 5-tier" - Massimo Gnerucci - 04-24-2019 05:36 AM (04-23-2019 04:59 PM)Albert Chan Wrote: sb_find(), version 6. Switched to Python to extend search range. 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: Have a nice day! RE: [VA] Short & Sweet Math Challenge #24: "2019 Spring Special 5-tier" - Valentin Albillo - 04-24-2019 07:57 PM 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 : Thanks a lot for your RPL/NewRPL 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. 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:
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:
So, what this individual, Mr. Chan, is continuously doing amounts to:
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. RE: [VA] Short & Sweet Math Challenge #24: "2019 Spring Special 5-tier" - Albert Chan - 04-24-2019 08:30 PM Hi, Valentin Albillo I did not know people were offended. I had deleted all posts since your last posting. Sorry about that ... I did explain my HP-12C can't handle primes. I am learning the emulation software, but that take some time ... Tried FPRIM(n) in emu71, but only gives "Err: Invalid Expr" This is from your last PM to me: Valentin Albillo Wrote:Hi, Albert Chan: Update: Replaced all my Python code with XCas, so HP Prime user can try out. The 1 Mathematica post and Lua code got quoted by others, so I felt better leave it alone. At the time, I was too excited when cin puzzle is solved in my head ... RE: [VA] Short & Sweet Math Challenge #24: "2019 Spring Special 5-tier" - Albert Chan - 04-26-2019 06:13 PM I did downloaded the Emu71/Windows, but unable to get the code fully worked out. HP-71B BASIC code below only print out possible sb candidates. The program cannot be completed without ISPRIME(), so I never posted it. What it does is output values of permutations of base-B digits that have the inputed sb value. Quote:10 INPUT "BASE ?"; B Example: for base-7, upto 12 decimal digits => 15 base-7 digits >RUN >BASE ? 7 >DIGITS ? 15 >SB VALUE ? 65 1694851493 → 1936973135 → 1971561941 (first prime) >RUN >BASE ? 7 >DIGITS ? 15 >SB VALUE ? 77 83047723205 → 94911683663 → 96606535157 → 96848656799 (first prime) BTW, where to get ISPRIME() (or equivalent) for the HP-71B emulator ? Edit: change PRINT "X?" @ INPUT X to INPUT "X?";X RE: [VA] Short & Sweet Math Challenge #24: "2019 Spring Special 5-tier" - rprosperi - 04-26-2019 09:50 PM (04-26-2019 06:13 PM)Albert Chan Wrote: I did downloaded the Emu71/Windows, but unable to get the code fully worked out. Congratulations Albert, on upgrading to EMU71! I think you will find much more participation by others with your posts if they include HP code. You happen to have made a good choice as the 71B is my favorite machine, so I can answer many questions about using it, but I can't contribute much regarding a lot of the math you frequently post. For ISPRIME(), I don't have a LEX file with this, however the PRIMLEX LEX file (PRIM(X) returns the lowest Prime factor of X) found on this page may meet the need. Also, to input N with a prompt, use this: 100 INPUT "What is N?"; N RE: [VA] Short & Sweet Math Challenge #24: "2019 Spring Special 5-tier" - Gilles - 04-26-2019 11:36 PM (03-28-2019 12:38 AM)Valentin Albillo Wrote: Tier 1 - The Challenge: Good catch the divisibility by 9. I totaly missed this. RE: [VA] Short & Sweet Math Challenge #24: "2019 Spring Special 5-tier" - Albert Chan - 04-28-2019 11:08 AM Hi, rprosperi Thanks for the tip. I finally get FPRIM working, but had to switched to EMU71/DOS This is my updated HP71B BASIC listing. Quote:10 ON ERROR GOTO 190 >RUN BASE? 7 25 4801 35 201683 49 16470859 55 115296019 65 1971561941 77 96848656799 85 -1.3564461457E12 >RUN BASE? 31 49 619 77 18257 91 59581 119 1787459 121 2769601 133 13851853 143 22164503 161 372178931 169 629810569 187 7987533097 203 23073248663 209 54109095389 217 247613526037 221 357635354291 247 -6.82312829953E12 253 -1.19404745241E13 259 -1.70578207488E13 Ignore lines with negative numbers. It just meant T (for the sb value) overflow 12 digits. Note: It is possible primes not in sorted order. Example: >RUN BASE? 2 4 23 6 311 8 383 ... 36 206141652991 38 -1.01361228185E12 <- actual T = 1030791102463 39 824633720831 40 -1.09951162777E12 <- actual T = 2196875771903 |