Post Reply 
33s Evaluates Some Large Powers 50g Refuses
08-18-2022, 01:57 PM (This post was last modified: 08-18-2022 02:04 PM by John Keith.)
Post: #4
RE: 33s Evaluates Some Large Powers 50g Refuses
Though it doesn't address the issue of integer powers, we can get the result for any number < 2^63 using binary numbers with #3 XOR. this works on any RPL calculator but requires entering the number with a leading #. The 3 can be replaced with any other integer to return values for similar sequences since Nim addition is just XOR.

Going even farther afield, we can make lists of A004444 and similar sequences very rapidly using ListExt commands on the 50g by taking advantage of the structure of the sequence (groups of 4 consecutive numbers reversed). Given a number n on the stack, the following program returns 4n terms of the sequence. If the 4's in the program are replaced with 2's, the program will return 2n terms of A004442.

Code:

\<< 0 SWAP 4 * 1 - LSEQR @ List of numbers 0 to 4n-1
    4 LSDIV              @ Break up into sublists of 4                 
    :: REV LMAP          @ Reverse each sublist
    LXIL                 @ Flatten list
\>>

With the number 250 on the stack, the program returns the first 1000 terms in 1.5 seconds on my 50g.
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: 33s Evaluates Some Large Powers 50g Refuses - John Keith - 08-18-2022 01:57 PM



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