Page 1 of 1

Problem 485

Posted: Mon Jan 19, 2015 7:12 pm
by Oliver1978
Let d(n) be the number of divisors of n.
Are 1 and n also considered to be divisors of n in this problem?

Re: Problem 485

Posted: Mon Jan 19, 2015 7:41 pm
by nicolas.patrois
Why not?

Re: Problem 485

Posted: Mon Jan 19, 2015 7:48 pm
by Oliver1978
Only making sure I don't miss anything ;)

Re: Problem 485

Posted: Mon Dec 03, 2018 5:38 pm
by Jochen_P
I keep getting 16739 for S(1000,10), pretty fast but obviously wrong.
This drives me mad :evil:

I'm pretty sure my algo for S() should work though. Got the wrong result for the problems answer in about 126 seconds :mrgreen:

Anyone keen to give a second pair of eyes on my python code, or experienced the same dead end and give a hint?

Re: Problem 485

Posted: Tue Dec 04, 2018 12:07 am
by kenbrooker
Jochen_P wrote: Mon Dec 03, 2018 5:38 pm I keep getting 16739 for S(1000,10), pretty fast but obviously wrong.
This drives me mad :evil:
You might want to reconsider the number of divisors you compute for perfect squares...

Re: Problem 485

Posted: Tue Dec 04, 2018 12:09 pm
by Jochen_P
Hi Ken,

good hint, but my Divisor Count function is ok (got the correct result for S(1000,10) by doing it the naive way, which would take days for the original Problem)

There is something obvious wrong with my S() implementation which I just don't see yet .. proofed only test cases yet, maybe there are exceptions I don't have realized yet.
Will run it with lower bounds and debug prints tonight :)

Re: Problem 485

Posted: Tue Dec 04, 2018 1:34 pm
by Jochen_P
Crickey!

this was a real brainf* regarding zero based indexes and bounds and predictive computing in reachable ranges.
Brain hurts big time, but now I got the test case correct :mrgreen: (below 1 msec)

[edit] sure enough my final answer is still wrong! I hate this problem [/edit]

Re: Problem 485

Posted: Tue Dec 04, 2018 2:08 pm
by Jochen_P
Finally!

one minor tweak made it general use ... Phew, that was hard work. [you may visit the problems forum post #91 to make fun of me ;)]
Now only one to go to reach level 8 :roll:

Re: Problem 485

Posted: Tue Dec 04, 2018 6:16 pm
by kenbrooker
Jochen_P wrote: Tue Dec 04, 2018 2:08 pm Finally! Now only one to go to reach level 8 :roll:
:D :D :D :D :D :D :D :D