Are 1 and n also considered to be divisors of n in this problem?Let d(n) be the number of divisors of n.
Problem 485
Forum rules
As your posts will be visible to the general public you are requested to be thoughtful in not posting anything that might explicitly give away how to solve a particular problem.
This forum is NOT meant to discuss solution methods for a problem.
See also the topics:
Don't post any spoilers
Comments, questions and clarifications about PE problems.
As your posts will be visible to the general public you are requested to be thoughtful in not posting anything that might explicitly give away how to solve a particular problem.
This forum is NOT meant to discuss solution methods for a problem.
In particular don't post any code fragments or results.
Don't start begging others to give partial answers to problems
Don't ask for hints how to solve a problem
Don't start a new topic for a problem if there already exists one
Don't start begging others to give partial answers to problems
Don't ask for hints how to solve a problem
Don't start a new topic for a problem if there already exists one
See also the topics:
Don't post any spoilers
Comments, questions and clarifications about PE problems.
- Oliver1978
- Posts: 166
- Joined: Sat Nov 22, 2014 9:13 pm
- Location: Erfurt, Germany
Problem 485
49.157.5694.1125
- nicolas.patrois
- Posts: 118
- Joined: Fri Jul 26, 2013 4:54 pm
- Contact:
- Oliver1978
- Posts: 166
- Joined: Sat Nov 22, 2014 9:13 pm
- Location: Erfurt, Germany
- Jochen_P
- Posts: 55
- Joined: Mon Oct 05, 2009 10:47 am
- Location: Stuttgart, Germany
Re: Problem 485
I keep getting 16739 for S(1000,10), pretty fast but obviously wrong.
This drives me mad
I'm pretty sure my algo for S() should work though. Got the wrong result for the problems answer in about 126 seconds
Anyone keen to give a second pair of eyes on my python code, or experienced the same dead end and give a hint?
This drives me mad
I'm pretty sure my algo for S() should work though. Got the wrong result for the problems answer in about 126 seconds
Anyone keen to give a second pair of eyes on my python code, or experienced the same dead end and give a hint?

- kenbrooker
- Posts: 187
- Joined: Mon Feb 19, 2018 3:05 am
- Location: Northern California, USA
Re: Problem 485
You might want to reconsider the number of divisors you compute for perfect squares...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![]()
"Good Judgment comes from Experience;
Experience comes from Bad Judgment..."

Experience comes from Bad Judgment..."

- Jochen_P
- Posts: 55
- Joined: Mon Oct 05, 2009 10:47 am
- Location: Stuttgart, Germany
Re: Problem 485
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
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

- Jochen_P
- Posts: 55
- Joined: Mon Oct 05, 2009 10:47 am
- Location: Stuttgart, Germany
Re: Problem 485
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
(below 1 msec)
[edit] sure enough my final answer is still wrong! I hate this problem [/edit]
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
[edit] sure enough my final answer is still wrong! I hate this problem [/edit]

- Jochen_P
- Posts: 55
- Joined: Mon Oct 05, 2009 10:47 am
- Location: Stuttgart, Germany
Re: Problem 485
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
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

- kenbrooker
- Posts: 187
- Joined: Mon Feb 19, 2018 3:05 am
- Location: Northern California, USA
