Problem 485

A place to air possible concerns or difficulties in understanding ProjectEuler problems. This forum is not meant to publish solutions. This forum is NOT meant to discuss solution methods or giving hints how a problem can be solved.
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.

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


See also the topics:
Don't post any spoilers
Comments, questions and clarifications about PE problems.
Post Reply
User avatar
Oliver1978
Posts: 165
Joined: Sat Nov 22, 2014 9:13 pm
Location: Erfurt, Germany

Problem 485

Post by Oliver1978 » Mon Jan 19, 2015 7:12 pm

Let d(n) be the number of divisors of n.
Are 1 and n also considered to be divisors of n in this problem?
49.157.5694.1125

User avatar
nicolas.patrois
Posts: 117
Joined: Fri Jul 26, 2013 3:54 pm
Contact:

Re: Problem 485

Post by nicolas.patrois » Mon Jan 19, 2015 7:41 pm

Why not?
Image

User avatar
Oliver1978
Posts: 165
Joined: Sat Nov 22, 2014 9:13 pm
Location: Erfurt, Germany

Re: Problem 485

Post by Oliver1978 » Mon Jan 19, 2015 7:48 pm

Only making sure I don't miss anything ;)
49.157.5694.1125

User avatar
Jochen_P
Posts: 52
Joined: Mon Oct 05, 2009 9:47 am
Location: Stuttgart, Germany

Re: Problem 485

Post by Jochen_P » 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:

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?
Image

User avatar
kenbrooker
Posts: 120
Joined: Mon Feb 19, 2018 3:05 am
Location: Oregon, USA

Re: Problem 485

Post by kenbrooker » Tue Dec 04, 2018 12:07 am

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...
"Good Judgment comes from Experience;
Experience comes from Bad Judgment
..."
Image

User avatar
Jochen_P
Posts: 52
Joined: Mon Oct 05, 2009 9:47 am
Location: Stuttgart, Germany

Re: Problem 485

Post by Jochen_P » Tue Dec 04, 2018 12:09 pm

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 :)
Image

User avatar
Jochen_P
Posts: 52
Joined: Mon Oct 05, 2009 9:47 am
Location: Stuttgart, Germany

Re: Problem 485

Post by Jochen_P » Tue Dec 04, 2018 1:34 pm

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]
Image

User avatar
Jochen_P
Posts: 52
Joined: Mon Oct 05, 2009 9:47 am
Location: Stuttgart, Germany

Re: Problem 485

Post by Jochen_P » Tue Dec 04, 2018 2:08 pm

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:
Image

User avatar
kenbrooker
Posts: 120
Joined: Mon Feb 19, 2018 3:05 am
Location: Oregon, USA

Re: Problem 485

Post by kenbrooker » Tue Dec 04, 2018 6:16 pm

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
"Good Judgment comes from Experience;
Experience comes from Bad Judgment
..."
Image

Post Reply