RPL exercise - Last Digits of Primes (HP 49G, G+, 50g)
|
06-03-2019, 03:49 AM
Post: #24
|
|||
|
|||
RE: RPL exercise - Last Digits of Primes (HP 49G, G+, 50g)
(06-01-2019 12:48 PM)grsbanks Wrote:(06-01-2019 08:51 AM)Carsen Wrote: ...test if the digit is a 1, 3, 7, 9, or none of the aboveHow could it be none of the above? Oops. ![]() (06-01-2019 02:38 PM)Valentin Albillo Wrote:(06-01-2019 08:51 AM)Carsen Wrote: Here's my take on the challenge. The algorithm is very straightforward. Get the next prime number, put it in a string, retrieve the last digit in the string [...] Okay. That makes a lot of sense, especially after I single stepped (SST) through DavidM's first RPL program that he posted in this thread because he did exactly what you described Valentin. After reflecting other's variants of code, this exercise will remind me how useful the MOD function can be in programming because I never really use it. (06-01-2019 03:17 PM)Gerson W. Barbosa Wrote: Just two remarks: Nice! Save 3 seconds in Exact mode! I sure like that. I have a question on remark 1 Gerson. Why should my STR-> be replaced with an OBJ->? Thanks everyone! |
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 1 Guest(s)