OEIS A167390: Cumbersome formula - Printable Version +- HP Forums (https://www.hpmuseum.org/forum) +-- Forum: HP Calculators (and very old HP Computers) (/forum-3.html) +--- Forum: General Forum (/forum-4.html) +--- Thread: OEIS A167390: Cumbersome formula (/thread-18724.html) |
OEIS A167390: Cumbersome formula - Gerald H - 08-28-2022 10:39 AM Some years ago I came up with a formula to calculate the elements of this series https://oeis.org/A167390 & while the formula gives correct answers I am uncomfortable with it & fail to find a more economic replacement. I am interested to see if any members here can suggest a more elegant solution. On my HP 33s the programme has LN = 155 CK = 7D43 RE: OEIS A167390: Cumbersome formula - Allen - 08-28-2022 11:52 AM Code:
Interesting problem, at first I though this wasn't a useful sequence, but after some more review, I believe you've found a very dangerous generating sequence from the Book of Armaments! If you are so inclined with difficult, but not useful problems (as many of us are!) rather than obtuse sequences from OEIS, may I suggest some of the problems from Project Euler? Unlike the dusty corners of integer sequences, many Euler Problems are of practical use, and are FAR more pedagogically useful (even if some can't be done on the hand held), many can. RE: OEIS A167390: Cumbersome formula - Allen - 08-28-2022 07:52 PM It's probably more comprehensible to understand the function NOT through the OEIS description, but by looking a the derivative of the integer sequence.. [0,1,2,4,3,9,5,16,6,25,7,36,8,49,10,64 ] so the general pseudo code is: Code:
This lends itself well to loops in RPN rather than a closed form solution (not optimized for size- probably missing some obvious byte savings): (NOTE: Unlike the original OEIS sequence, I assume f(0)==0 so there is no offset to contend with.) Code:
|