Problem 347

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
mdean
Posts: 206
Joined: Tue Aug 02, 2011 2:05 am

Problem 347

Post by mdean »

Just to be clear, would S(10) be 16 or 32?
Image
User avatar
hk
Administrator
Posts: 12842
Joined: Sun Mar 26, 2006 10:34 am
Location: Haren, Netherlands

Re: Problem 347

Post by hk »

16.
Image
War ruins the life and health of untold numbers of innocent children.
xe3tec
Posts: 46
Joined: Thu May 05, 2011 8:52 am
Location: Vienna
Contact:

Re: Problem 347

Post by xe3tec »

I am going nuts. S(10) is fine. but my S(100) ist 22 too big...
Could someone giv me some M(p,q,100) results plz? I cant find my mistake. My function works for the the given examples.

Some(got more obviously) examples from me: with result, p,q

92 23 2
69 23 3
58 29 2
87 29 3
62 31 2
93 31 3
74 37 2
82 41 2
86 43 2
94 47 2

Otherwise the results for S(100) would be nice for comparison.
thundre
Posts: 356
Joined: Sun Mar 27, 2011 10:01 am

Re: Problem 347

Post by thundre »

mdean wrote:Just to be clear, would S(10) be 16 or 32?
I think adding "p<q" somewhere in the problem statement would make this issue more clear.

Detailed results for N=100 for xe3tec:

p q M(p,q,100)
Expand
3 2 96
5 2 100
5 3 75
7 2 98
7 3 63
7 5 35
11 2 88
11 3 99
11 5 55
11 7 77
13 2 52
13 3 39
13 5 65
13 7 91
17 2 68
17 3 51
17 5 85
19 2 76
19 3 57
19 5 95
23 2 92
23 3 69
29 2 58
29 3 87
31 2 62
31 3 93
37 2 74
41 2 82
43 2 86
47 2 94
sum is 2262
Image
xe3tec
Posts: 46
Joined: Thu May 05, 2011 8:52 am
Location: Vienna
Contact:

Re: Problem 347

Post by xe3tec »

merci beaucoup

corrected my algo, its still way too lame :lol:
nemoyatpeace
Posts: 10
Joined: Thu Sep 09, 2010 12:24 am

Re: Problem 347

Post by nemoyatpeace »

Hmmmm, my S(100) works fine, my S(10) works fine, but my result for S(10000000) is wrong. Can't figure out what I'm doing wrong.

Can I confirm a value for S(1000) = 193408


Grrrr, figured it out. I was missing a few values because of poor loops. Fixed now.
Image
robman8855
Posts: 1
Joined: Mon Aug 13, 2012 12:33 am

Re: Problem 347

Post by robman8855 »

I might be having the same problem as a few others. I'm getting
S(10)=16
S(100)= 2262
S(1000)=193408
S(10000)=16373230
S(100000)=1247352396
S(1000000)=72248285794
S(10000000)=5809021439045

I have no idea where I'm going wrong. As far as I can tell my code is perfect but something must be wrong because I'm getting the wrong answer. can anyone verify these values for S?
User avatar
peedyoJ
Posts: 19
Joined: Sat Aug 11, 2012 3:03 pm

Re: Problem 347

Post by peedyoJ »

Look at the post above yours.....
"When in doubt, use brute force" - Ken Thompson.
Post Reply