HP 49G Programming Challenge: OEIS A014261, Integers with exclusively Odd Digits
|
08-31-2017, 12:49 PM
Post: #28
|
|||
|
|||
RE: HP 49G Programming Challenge: OEIS A014261, Integers with exclusively Odd Digits
(08-29-2017 04:02 PM)Didier Lachieze Wrote: My RPL is a bit rusty, so instead here is an HP Prime program: This is brilliant work. I've done some programming in many languages, but I've always had a mental block when it comes to recursion. I understand it, but am unable to employ it as a tool. It seems like cheating to get a solution that is dependent on a solution using the self-referenced routine. As such, how this routine is derived, ensuring that all of the digits are odd, is nearly magic to me. I would've tried a deconstruction/digit-checking routine that would certainly have been much slower, and much more of a memory hog. Didier, is it possible for you to shed some light on how you approached this problem? It took me half an hour to understand how it works, and now that I do, I'm curious how you arrived at it. If you could dumb it down a bit, I'd be interested in the process. Kudos to you for such an elegant solution. Brad |
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 16 Guest(s)