(34S) Prime Factors
|
05-30-2014, 08:58 PM
Post: #7
|
|||
|
|||
RE: (WP-34S) Prime Factors
(05-30-2014 08:07 PM)Dave Britten Wrote: My hunch is that repeatedly calling NEXTP like that causes a ton of duplicated work. I don't imagine there's any sophisticated caching going on with the limited RAM in the 30b hardware. (See: Schlemiel the Painter) The important thing is: we don't need to know whether a factor is prime or not to figure out if it divides the number. What ever the complexity of PRIME? may be (O(k log3n) according to Wikipedia), it can't be faster than a simple division. Thus if NEXTP has to test all the next odd numbers we don't gain anything. Using the MOD 30 loop you even gain a factor 1.875 compared to the minimal routine using only odd numbers. How does your program compare to the built-in program PF? Kind regards Thomas |
|||
« Next Oldest | Next Newest »
|
Messages In This Thread |
(34S) Prime Factors - Dave Britten - 05-30-2014, 01:53 AM
RE: (WP-34S) Prime Factors - Thomas Klemm - 05-30-2014, 03:30 AM
RE: (WP-34S) Prime Factors - Dave Britten - 05-30-2014, 03:54 AM
RE: (WP-34S) Prime Factors - Thomas Klemm - 05-30-2014, 08:24 AM
RE: (WP-34S) Prime Factors - Thomas Klemm - 05-30-2014, 07:06 PM
RE: (WP-34S) Prime Factors - Dave Britten - 05-30-2014, 08:07 PM
RE: (WP-34S) Prime Factors - Thomas Klemm - 05-30-2014 08:58 PM
RE: (WP-34S) Prime Factors - Dave Britten - 05-30-2014, 09:42 PM
RE: (WP-34S) Prime Factors - Thomas Klemm - 05-30-2014, 10:57 PM
RE: (WP-34S) Prime Factors - Dave Britten - 05-30-2014, 11:58 PM
RE: (WP-34S) Prime Factors - Dave Britten - 05-31-2014, 01:09 AM
RE: (WP-34S) Prime Factors - Dave Britten - 06-01-2014, 06:11 PM
RE: (WP-34S) Prime Factors - performance challenge - Dirk E. - 02-23-2015, 08:02 PM
|
User(s) browsing this thread: 1 Guest(s)