Skip to main content

Timeline for Number of divisors of a factorial

Current License: CC BY-SA 3.0

16 events
when toggle format what by license comment
Jun 6 at 10:01 answer added gnasher729 timeline score: 3
Jun 6, 2016 at 17:31 comment added DarthGizka @John: I've updated my answer with a new way of speeding things up (by a factor of 20 for the SPOJ limit of 50000). You might find this interesting.
Jun 4, 2016 at 16:54 comment added sid597 @DarthGizka that is awesome this actually reduced time to 0.37 (and this is the fastest solution for this problem ) I also improved the prime sieve and updated this in your post along with your code
Jun 3, 2016 at 20:35 vote accept sid597
Jun 3, 2016 at 20:31 vote accept sid597
Jun 3, 2016 at 20:34
Jun 3, 2016 at 17:26 answer added DarthGizka timeline score: 8
Jun 3, 2016 at 11:07 comment added sid597 @TadhgMcDonald-Jensen that helped a bit my earlier code took 1.63 and after what you told it took 1.59
Jun 3, 2016 at 9:28 comment added Sjoerd Job Postmus @Tadhg McDonald-Jensen: why not use that excellent observation to start off a review?
Jun 2, 2016 at 20:34 comment added Tadhg McDonald-Jensen nevermind the log, just tested and math.log isn't exactly accurate so it probably wouldn't work.. but the loop while n>=num**exp : s+=int(n/(num**exp)) ; exp+=1 calculates num**exp twice per iteration, it would be more efficient to do power = 1 ; while n>=power: power*=num ; s+=n//power
Jun 2, 2016 at 20:08 comment added sid597 @TadhgMcDonald-Jensen can you elobrate I am not getting the point
Jun 2, 2016 at 20:06 history edited Gareth Rees CC BY-SA 3.0
link to the original problem
Jun 2, 2016 at 20:04 history edited 200_success CC BY-SA 3.0
added 123 characters in body; edited tags; edited title
Jun 2, 2016 at 20:03 comment added Tadhg McDonald-Jensen hmm, couldn't you use logarithms to find the power of each prime that is close to the test number?
Jun 2, 2016 at 19:51 history edited janos
edited tags
Jun 2, 2016 at 19:31 review First posts
Jun 2, 2016 at 21:36
Jun 2, 2016 at 19:27 history asked sid597 CC BY-SA 3.0