Page 3 of 3

Re: Problem 165

Posted: Sun Dec 31, 2017 7:10 am
by traxex
I found two problems that use "unique" in this sense: Problem 201 (View Problem) and Problem 136 (View Problem). For maximum clarity, they both also use the alternative wording "exactly one".

Re: Problem 165

Posted: Sun Dec 31, 2017 2:21 pm
by CherylLynn
Thanks all,
I did notice the 1st post in the thread for problem 165 uses the Java TreeSet<cls> class; this leaves 1 copy of the duplicates in the collection. Live and learn; I will never confuse the difference between distinct and unique again. I spent way too much time trying to find the bug or design flaw in my implementation when my issue was definition.

Re: Problem 165

Posted: Wed May 11, 2022 1:23 am
by gettyst
I think there is an error in the problem statement, but it is very hard to believe after all the time it has been there. Still, the only way I get the first 4 t-numbers stated in the problem (27, 144, 12 and 232) is to use tn = sn+1 (modulo 500), whereas the description of the algorithm says tn = sn (modulo 500).

Re: Problem 165

Posted: Wed May 11, 2022 1:58 am
by mdean
gettyst wrote: Wed May 11, 2022 1:23 am I think there is an error in the problem statement, but it is very hard to believe after all the time it has been there. Still, the only way I get the first 4 t-numbers stated in the problem (27, 144, 12 and 232) is to use tn = sn+1 (modulo 500), whereas the description of the algorithm says tn = sn (modulo 500).
You do realize you start with $t_1$ and not $t_0$, correct? Using Windows Calculator, I get $s_1=629,527$ and $t_1=27$.

Re: Problem 165

Posted: Wed May 11, 2022 7:33 pm
by gettyst
Got it. Thank you for replying.

Re: Problem 165

Posted: Tue Apr 30, 2024 12:54 am
by SAG145
I checked my result for 100,500 and 700 segments and checked the code again and again but I just can't find the problem.
Can someone please verify the following results?

For the first 1000 segments the answer is 113744
For the first 2500 segments the answer is 707686
For the 4000 odd segments the answer is 1834798
Removing the duplicates (for the 5000 segments) subtracts 121 from the final result.

Thanks :)

Re: Problem 165

Posted: Tue Apr 30, 2024 1:28 am
by whatteaux
Your figures for 1000 and 2500 segments are too low.

Re: Problem 165

Posted: Sun May 05, 2024 2:31 pm
by SAG145
I solved the problem, thanks!