Problem 155
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.
-
viv_ban
- Posts: 23
- Joined: Mon May 26, 2008 3:09 pm
Problem 155
Can anybody please confirm me if the values D(4) = 15 and D(5) = 35 are correct.
thanks in advance.
thanks in advance.
- Tommy137
- Posts: 238
- Joined: Sun Feb 24, 2008 6:02 pm
- Location: Cologne, Germany
- Contact:
-
viv_ban
- Posts: 23
- Joined: Mon May 26, 2008 3:09 pm
Re: problem 155
Thanks Tommy. I really cannot understand the problem with my algorithm. Is D(10) = 2491.
- Tommy137
- Posts: 238
- Joined: Sun Feb 24, 2008 6:02 pm
- Location: Cologne, Germany
- Contact:
-
Schwein
- Posts: 3
- Joined: Mon Aug 15, 2011 3:57 am
Re: problem 155
I don't get it either...
Is it wrong to think, that the only new capacitor combinations are the ones from the previous, with max number of capacitors, + a series and a paralel with a new 60 microfahrad capacitor?
ex
if we have 2 2 capacitor combinations, then there will be 4 extra in the next, and 8 extra in the next and so on?
I cannot imagine how else a combination would be made, but then my D(5) = 31, and i don't see where the 4 extra comes from
Is it wrong to think, that the only new capacitor combinations are the ones from the previous, with max number of capacitors, + a series and a paralel with a new 60 microfahrad capacitor?
ex
if we have 2 2 capacitor combinations, then there will be 4 extra in the next, and 8 extra in the next and so on?
I cannot imagine how else a combination would be made, but then my D(5) = 31, and i don't see where the 4 extra comes from
- jaap
- Posts: 588
- Joined: Tue Mar 25, 2008 3:57 pm
- Contact:
Re: problem 155
Hint: 5 = 1+4 = 2+3Schwein wrote:I cannot imagine how else a combination would be made, but then my D(5) = 31, and i don't see where the 4 extra comes from
Remember also that we only care about the different values - some values can be made in several completely different ways, so that is another reason why it won't be a simple doubling sequence.
-
Schwein
- Posts: 3
- Joined: Mon Aug 15, 2011 3:57 am
Re: problem 155
I had the part covered, that some values might be equal(turned out none of them were, when i just added one in series, and one in paralel, for each combo), the only thing i don't understand, is why that does not give me all the different combinations makeable...
- Lord_Farin
- Posts: 239
- Joined: Wed Jul 01, 2009 10:43 am
- Location: Netherlands
Re: problem 155
How about combining larger, 'composite' capacitors in series or parallel? (This is what hk meant above as well)Schwein wrote:the only thing i don't understand, is why that does not give me all the different combinations makeable...
Think about $1 = \frac1{1+1}+\frac1{1+1}$.

-
Schwein
- Posts: 3
- Joined: Mon Aug 15, 2011 3:57 am
-
Erf_Erf
- Posts: 5
- Joined: Sun Jan 12, 2014 12:12 pm
Re: problem 155
It seems I can't get it right... I get the correct results for D(4) and D(5). Then D(6) = 76 and D(10) = 2147. Are these values correct?

- mpiotte
- Administrator
- Posts: 1961
- Joined: Tue May 08, 2012 5:40 pm
- Location: Montréal, Canada
Re: problem 155
No.Erf_Erf wrote:It seems I can't get it right... I get the correct results for D(4) and D(5). Then D(6) = 76 and D(10) = 2147. Are these values correct?

-
Erf_Erf
- Posts: 5
- Joined: Sun Jan 12, 2014 12:12 pm
Re: problem 155
I just found the annoyingly trivial and almost invisible mistake in my code, and finally got the correct answer.

-
DeKlod
Re: problem 155
Hi all,
Could I ask for two pieces of input here:
1) D(13) is a 5-digit figure starting with a 4 and ending in an even digit - is that correct?
2) I'm using float values in C and my suspicion is that my solutions turns out wrong because of a precision issue. I've tried (long) double but the result is no more convincing. Should I try to go for the alternative of defining and manipulating fractions (as Wodehouse would have said: I've just had a look at what my mind is doing, and it turns out: it boggles!) or should I rather look for something else - my choice of value for the capacitance for example.
Cheers,
Claude
Could I ask for two pieces of input here:
1) D(13) is a 5-digit figure starting with a 4 and ending in an even digit - is that correct?
2) I'm using float values in C and my suspicion is that my solutions turns out wrong because of a precision issue. I've tried (long) double but the result is no more convincing. Should I try to go for the alternative of defining and manipulating fractions (as Wodehouse would have said: I've just had a look at what my mind is doing, and it turns out: it boggles!) or should I rather look for something else - my choice of value for the capacitance for example.
Cheers,
Claude
- Jochen_P
- Posts: 55
- Joined: Mon Oct 05, 2009 10:47 am
- Location: Stuttgart, Germany
Re: problem 155
Claude,
to answer your first question:
D(13) is indeed a 5-digit figure but it starts with 3 and ends with an odd digit.
hth
Jochen
to answer your first question:
D(13) is indeed a 5-digit figure but it starts with 3 and ends with an odd digit.
hth
Jochen

-
DeKlod
-
DeKlod
Re: Problem 155
Right, got there in the end, although the program takes about 40 seconds to come up with the answer...
Thanks for the help again!
Claude
Thanks for the help again!
Claude
-
Luis_AM3C
- Posts: 1
- Joined: Wed Apr 22, 2020 5:39 pm
Re: Problem 155
Hello,
I am trying to resolve this problem in Hacker Rank, but my solution only is successfull from 1 until 4.
For n = 5 and C=60, I got 31 results:
12, 15, 17.1429, 20, 22.5, 24, 25.7143, 30, 34.2857, 36, 37.5, 40, 42.8571, 45, 48, 60, 75, 80, 84, 90, 96, 100, 105, 120, 140, 150, 160, 180, 210, 240, 300
Can someone show me other different numeric result?
Thanks
I am trying to resolve this problem in Hacker Rank, but my solution only is successfull from 1 until 4.
For n = 5 and C=60, I got 31 results:
12, 15, 17.1429, 20, 22.5, 24, 25.7143, 30, 34.2857, 36, 37.5, 40, 42.8571, 45, 48, 60, 75, 80, 84, 90, 96, 100, 105, 120, 140, 150, 160, 180, 210, 240, 300
Can someone show me other different numeric result?
Thanks
-
v6ph1
- Posts: 134
- Joined: Mon Aug 25, 2014 7:14 pm


