(33s) OEIS A000966: Prohibited Zero Endings of Factorials - Printable Version +- HP Forums (https://www.hpmuseum.org/forum) +-- Forum: HP Software Libraries (/forum-10.html) +--- Forum: General Software Library (/forum-13.html) +--- Thread: (33s) OEIS A000966: Prohibited Zero Endings of Factorials (/thread-9197.html) |
(33s) OEIS A000966: Prohibited Zero Endings of Factorials - Gerald H - 09-30-2017 10:02 AM [Edit 2022-07-23: Old line 5 of LBL A deleted as redundant.] The following five programmes together produce 4 sequences from the OEIS on the HP 33s. The 33s is a very fast calculator. The table below shows times on various HP calculators to calculate A966(88,888,888,888) using the programmes here presented & variously optimised for the respective calculator. Model Time in sec 42S 45 40G 40 38G 30 35s 18 39gs 14 50g User 8.8 33s 8 49G Sys 1.2 50g Sys 0.6 The first programme takes a real integer N from the stack & returns A966(N) to stack. https://oeis.org/A000966 Code: 1. LBL A Takes a real integer N from the stack & returns A228297(N) to stack. https://oeis.org/A228297 Code: 1. LBL B Takes a real integer N from the stack & returns A27868(N) to stack, leaving Y, Z & T stack levels unaltered. https://oeis.org/A027868 Code: 1. LBL C Takes a real integer N from the stack & returns A112765(N) to stack. https://oeis.org/A112765 Code: 1. LBL D Takes a real integer from the stack & stores remainder on division by 5 in R & quotient in Q & returns Q to stack, leaving Y, Z & T stack levels unaltered. Code: 1. LBL V RE: (33s) OEIS A000966: Prohibited Zero Endings of Factorials - pier4r - 09-30-2017 10:16 AM it is nice that you got hooked on oeis sequences! They provide nice inputs. RE: (33s) OEIS A000966: Prohibited Zero Endings of Factorials - Gerald H - 07-23-2022 10:14 AM In post #1 old line 5 of LBL A deleted as redundant. RE: (33s) OEIS A000966: Prohibited Zero Endings of Factorials - Gerald H - 04-17-2023 05:01 AM [Edit: When I say "improved" I mean more elegant & smaller - unfortunately this programme takes 2* the time of the original programme.] An improved version of programme "V": Takes a natural number from the stack & stores remainder on division by 5 in R & quotient in Q & returns Q to stack. Preserves stack. Code: 1. LBL V RE: (33s) OEIS A000966: Prohibited Zero Endings of Factorials - Steve Simpkin - 04-18-2023 05:13 AM (09-30-2017 10:02 AM)Gerald H Wrote: ... That is really amazing considering it is using an enhanced 6502 CPU core (Sunplus SPLB31A). |