|
-
Jun 28th, 2014, 05:29 PM
#1
Re: Using a mathematical identity to speed up certain calculations.
re post #10, I can see that you are going to have great difficulty avoiding subtracting the same numbers more than once when different multiples 'intersect'. I assume that is what you are struggling to resolve...
If you don't know where you're going, any road will take you there...
My VB6 love-children: Vee-Hive and Vee-Launcher
-
Jun 28th, 2014, 05:49 PM
#2
Re: Using a mathematical identity to speed up certain calculations.
 Originally Posted by ColinE66
re post #10, I can see that you are going to have great difficulty avoiding subtracting the same numbers more than once when different multiples 'intersect'. I assume that is what you are struggling to resolve...
Yep - I'm trying to find a generic function which internally makes use of the O(1)-category n*(n+1)/2 approach,
to avoid the O(n) looping over the whole range.
Not sure, if your function in #12 really does speed-up what I posted in #8,
since I already had an early exit there, as soon as a valid factor was found
(not possible to count something twice).
When you use my function in #8 with n-1 as the parameter, then it wil always produce
the same results as yours for the same list of PrimeFactors.
Olaf
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|