(49G) OEIS A046034 : Numbers Composed Exclusively of Digits 2, 3, 5, 7

08312017, 07:11 AM
(This post was last modified: 08312017 07:17 AM by Gerald H.)
Post: #1




(49G) OEIS A046034 : Numbers Composed Exclusively of Digits 2, 3, 5, 7
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: :: 

09012017, 03:53 PM
Post: #2




RE: (49G) OEIS A046034 : Numbers Composed Exclusively of Digits 2, 3, 5, 7
A faster version of the programme:
Code: :: 

09012017, 11:11 PM
Post: #3




RE: (49G) OEIS A046034 : Numbers Composed Exclusively of Digits 2, 3, 5, 7
If you use the standard HP extable library and 50g's builtin assembler, you can use Gerald's source code if you add the following lines to the very beginning:
Code: EQU Z1_ 273B6 <0ɸ0> Joe 

09032017, 10:27 AM
Post: #4




RE: (49G) OEIS A046034 : Numbers Composed Exclusively of Digits 2, 3, 5, 7
But this programme is much faster & shorter:
Size: 146. CkSum: # 71CDh Code: :: 

09042017, 07:20 PM
Post: #5




RE: (49G) OEIS A046034 : Numbers Composed Exclusively of Digits 2, 3, 5, 7
With that last version, I get 146.5 bytes and #FA74h, and it just hangs when I run it.


09042017, 08:02 PM
Post: #6




RE: (49G) OEIS A046034 : Numbers Composed Exclusively of Digits 2, 3, 5, 7
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? 

09042017, 08:13 PM
Post: #7




RE: (49G) OEIS A046034 : Numbers Composed Exclusively of Digits 2, 3, 5, 7
A slightly shorter version:
Size: 132 CkSum: # 7092h Code: :: 

09042017, 11:39 PM
Post: #8




RE: (49G) OEIS A046034 : Numbers Composed Exclusively of Digits 2, 3, 5, 7
(09042017 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. <0ɸ0> Joe 

09052017, 12:50 AM
Post: #9




RE: (49G) OEIS A046034 : Numbers Composed Exclusively of Digits 2, 3, 5, 7
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! 

09052017, 09:16 AM
Post: #10




RE: (49G) OEIS A046034 : Numbers Composed Exclusively of Digits 2, 3, 5, 7
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 multimillionaire" 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. 

« Next Oldest  Next Newest »

User(s) browsing this thread: 1 Guest(s)