Sort 7 Discussions, By:
Please Login in order to post a comment
Does anyone else find the description highly complicated? I don't understand how the input values relate to the problem...
Indeed, for more clarity, I would rewrite the line 4 into:
... solutions of the equation f(n,1)=n are n= ....
and the line 7 into:
... the sum of all the solutions n for which ...
Look at the Project Euler problem itself. There is at least one typo as described above.
bayleef needs to spend time trying to get his explainations better
could any one explain this
Can anyone tell what the excatly function f(n,d) is ?
Consider a list of all positive integers <= n written in base b.
f(n,d) is the total number of times the digit "d" appears in that list.
I am not able to get problem exactely.
Can any one Around Here Who tell about problem statement clear to me just explain the problem not the solution.
As my code times out, I wonder how can we be sure that the sum s(d) is finite?
For example, if I test the case b=10 and d=1, I get:
f(n,1)=n for n=0
f(n,1)=n for n=1
f(n,1)=n for n=199981
f(n,1)=n for n=199982
f(n,1)=n for n=199983
f(n,1)=n for n=199984
f(n,1)=n for n=199985
f(n,1)=n for n=199986
f(n,1)=n for n=199987
f(n,1)=n for n=199988
f(n,1)=n for n=199989
f(n,1)=n for n=199990
f(n,1)=n for n=200000
f(n,1)=n for n=200001
f(n,1)=n for n=1599981
f(n,1)=n for n=35199990
f(n,1)=n for n=35200000
f(n,1)=n for n=35200001
I think that finding that bound is part of solving this problem.
However, I feel it increase infinitely.
Yes I found what to set as the upper boundary, it works for all bases.
The 32 test cases now complete without timing out. My problem now is that only 10 of them give the right answer, I wish I had one of the failed ones to see where is my error.
Let s(d) be the sum of all the solutions for which f(n,d) = n.
Does this mean that s(d) is the total number of solutions, or it is the summation of the number n for which the statement is true? The example in the instructions doesn't help clarify this...
See jbdfr_dnph's comment. It is the sum of n for which f(n,d) = n.
No more comments