(49G & 33s) OEIS A10785: Repdigit Numbers (in Human Readable Form)
|
10-11-2022, 05:20 PM
(This post was last modified: 10-12-2022 04:34 PM by Gerald H.)
Post: #1
|
|||
|
|||
(49G & 33s) OEIS A10785: Repdigit Numbers (in Human Readable Form)
For natural number input N the programme returns the Nth repdigit number in human readable form, eg
for input 19531808 the programme returna {8 2170201} to be read as the figure eight repeated 2170201 times. http://oeis.org/A010785 Size: 94.500 CkSum: # C8AEh Code: :: |
|||
10-12-2022, 03:52 AM
Post: #2
|
|||
|
|||
RE: (49G) OEIS A10785: Repdigit Numbers (in Human Readable Form)
The following User RPL program seems to produce the same outputs as your program, except for most inputs less than 1, which seems to me to be an acceptable limitation.
\<< 1 - 9 IDIV2 SWAP 2 \->LIST -1 - \>> BYTES: 35.5 CRC: #3E16h <0|ɸ|0> -Joe- |
|||
10-12-2022, 11:41 AM
Post: #3
|
|||
|
|||
RE: (49G) OEIS A10785: Repdigit Numbers (in Human Readable Form)
Thank you, Joe, for the clarity of your programme.
For the 33s the programme A produces a 2-level version of the repdigit & programme B takes the result of A & returns the position in the OEIS series. Preserves stack. Code: 1. LBL A |
|||
10-12-2022, 04:33 PM
Post: #4
|
|||
|
|||
RE: (49G) OEIS A10785: Repdigit Numbers (in Human Readable Form)
Slightly improved 33s programme, also deals correctly with 0 as input.
Code: 1. LBL A |
|||
10-13-2022, 07:06 AM
Post: #5
|
|||
|
|||
RE: (49G & 33s) OEIS A10785: Repdigit Numbers (in Human Readable Form)
Joe, I have adapted your suggestion for 33s & come up with
Code: 1. LBL C which gives wrong answers, eg 8 111111111112 for input 999999999998 whereas my programme returns correct 8 111111111111 Is my implementation faulty? |
|||
10-13-2022, 07:29 AM
(This post was last modified: 10-13-2022 07:29 AM by Joe Horn.)
Post: #6
|
|||
|
|||
RE: (49G & 33s) OEIS A10785: Repdigit Numbers (in Human Readable Form)
(10-13-2022 07:06 AM)Gerald H Wrote: ... No, you ran into a bug in the 33s when it evaluates "equations". If you store 999999999997 into N, then store IDIV(N:9)+1 in EQN, then execute it, the 33s returns the wrong answer (111111111112), whereas the 35s returns the correct answer (111111111111). Furthermore, the 33s returns the correct answer if you rewrite the program without using the EQN key. I do not not know whether this bug in the 33s has been found before, or if you are its first discoverer. <0|ɸ|0> -Joe- |
|||
10-13-2022, 08:11 AM
(This post was last modified: 10-13-2022 12:16 PM by Gerald H.)
Post: #7
|
|||
|
|||
RE: (49G & 33s) OEIS A10785: Repdigit Numbers (in Human Readable Form)
Edit: Line 14 corrected.
Yes, now gives correct answers. Code: 1. LBL C |
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 4 Guest(s)