![]() |
(49G) OEIS A046034 : Numbers Composed Exclusively of Digits 2, 3, 5, 7 - Printable Version +- HP Forums (https://www.hpmuseum.org/forum) +-- Forum: HP Software Libraries (/forum-10.html) +--- Forum: General Software Library (/forum-13.html) +--- Thread: (49G) OEIS A046034 : Numbers Composed Exclusively of Digits 2, 3, 5, 7 (/thread-8939.html) |
(49G) OEIS A046034 : Numbers Composed Exclusively of Digits 2, 3, 5, 7 - Gerald H - 08-31-2017 07:11 AM For integer input N the programme returns the Nth element of the series https://oeis.org/A046034 NB The description below uses the expression eg Z3_ for ZINT 3. The two are however NOT the same, Z3_ at PTR 273CE having 2.5 Bytes & ZINT 3 having 6 Bytes. The size & check sum below are for the version as printed. Code: :: RE: (49G) OEIS A046034 : Numbers Composed Exclusively of Digits 2, 3, 5, 7 - Gerald H - 09-01-2017 03:53 PM A faster version of the programme: Code: :: RE: (49G) OEIS A046034 : Numbers Composed Exclusively of Digits 2, 3, 5, 7 - Joe Horn - 09-01-2017 11:11 PM If you use the standard HP extable library and 50g's built-in assembler, you can use Gerald's source code if you add the following lines to the very beginning: Code: EQU Z1_ 273B6 RE: (49G) OEIS A046034 : Numbers Composed Exclusively of Digits 2, 3, 5, 7 - Gerald H - 09-03-2017 10:27 AM But this programme is much faster & shorter: Size: 146. CkSum: # 71CDh Code: :: RE: (49G) OEIS A046034 : Numbers Composed Exclusively of Digits 2, 3, 5, 7 - Eric Rechlin - 09-04-2017 07:20 PM With that last version, I get 146.5 bytes and #FA74h, and it just hangs when I run it. RE: (49G) OEIS A046034 : Numbers Composed Exclusively of Digits 2, 3, 5, 7 - Gerald H - 09-04-2017 08:02 PM I just copied the published source code & compiled on my 50g. Result is that programme works correctly, size 146 Cksum 71CD. Has anyone besides Eric had problems? RE: (49G) OEIS A046034 : Numbers Composed Exclusively of Digits 2, 3, 5, 7 - Gerald H - 09-04-2017 08:13 PM A slightly shorter version: Size: 132 CkSum: # 7092h Code: :: RE: (49G) OEIS A046034 : Numbers Composed Exclusively of Digits 2, 3, 5, 7 - Joe Horn - 09-04-2017 11:39 PM (09-04-2017 08:02 PM)Gerald H Wrote: Has anyone besides Eric had problems? Both of the versions above this reply run fine on my 50g, and have the sizes and checksums that you cited above. RE: (49G) OEIS A046034 : Numbers Composed Exclusively of Digits 2, 3, 5, 7 - Eric Rechlin - 09-05-2017 12:50 AM Hmmm...interesting. I am thinking this is a bug in Jazz. Using the same extable library, Jazz (which I have been using for all of Gerald's posts because I'm too lazy to add the !RPL !NO_CODE to the beginning and @ to the end) compiles it incorrectly, giving the incorrect bytes/checksum that I listed. The built in assembler (ASM) works fine. What makes it even more interesting is when I do a ->S2 on it, both the Jazz compiled code and the ASM compiled code decompile to the same source. Inspecting the hexadecimal representations of both shows the difference. They are almost identical. The only difference is that Jazz compiles the ZINT 0 to the following, which is a positive signed zero: 41620 (DOINT) 7000000 And ASM compiles ZINT 0 to the following, which is an unsigned zero (which is correct -- zero should not be signed): 41620 (DOINT) 600000 The former does not work; the latter works fine. But calling ->S2 on either yields the same thing: !NO CODE !RPL ZINT 0 @ Sorry for the false alarm, Gerald. Looks like Jazz is incorrectly putting a sign on zero! RE: (49G) OEIS A046034 : Numbers Composed Exclusively of Digits 2, 3, 5, 7 - Gerald H - 09-05-2017 09:16 AM Pleased to hear it works OK, Eric. It is pleasant to know that someone goes to the trouble of compiling & using my programmes. Indeed, some positive feedback would be nice as informing that there is some degree of interest in such programmes. I guess comments like "Best programme I've ever seen" or "This programme has changed my life" or "Before I used this programme I was a bum, now I'm a multi-millionaire" would be appropriate. However, most members of the forum don't always write what they believe but moderate their expressions to something like "Well done". Suggestions for improvements most welcome. RE: (49G) OEIS A046034 : Numbers Composed Exclusively of Digits 2, 3, 5, 7 - Gerald H - 07-09-2021 10:01 AM Having once again carried out my weekly review checking for improvements & none having been published I guess the programme above is perfectly perfect. Accordingly it may now be considered the final form. The programme below carries out the inverse transformation. I have attempted some error checking to ensure only compatible input is processed but it's better only to input correctly conformed integers. Not yet a multi-millionaire & time's running out. Code: Size: 157.5 |