OEIS A167390: Cumbersome formula
|
08-28-2022, 10:39 AM
Post: #1
|
|||
|
|||
OEIS A167390: Cumbersome formula
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 |
|||
08-28-2022, 11:52 AM
Post: #2
|
|||
|
|||
RE: OEIS A167390: Cumbersome formula
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. 17bii | 32s | 32sii | 41c | 41cv | 41cx | 42s | 48g | 48g+ | 48gx | 50g | 30b |
|||
08-28-2022, 07:52 PM
(This post was last modified: 08-28-2022 08:38 PM by Allen.)
Post: #3
|
|||
|
|||
RE: OEIS A167390: Cumbersome formula
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:
17bii | 32s | 32sii | 41c | 41cv | 41cx | 42s | 48g | 48g+ | 48gx | 50g | 30b |
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 1 Guest(s)