Problem 165
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.
-
traxex
- Posts: 66
- Joined: Thu Oct 19, 2017 1:30 pm
Re: Problem 165
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".
Technically, everyone is full of himself.
-
CherylLynn
- Posts: 2
- Joined: Sat Dec 30, 2017 4:36 pm
Re: Problem 165
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.
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.
- gettyst
- Posts: 12
- Joined: Fri Apr 22, 2022 1:14 am
Re: Problem 165
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).
“We have two lives, and the second begins when we realize we only have one.”
Confucius
Confucius
-
mdean
- Posts: 206
- Joined: Tue Aug 02, 2011 2:05 am
Re: Problem 165
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$.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).

- gettyst
- Posts: 12
- Joined: Fri Apr 22, 2022 1:14 am
Re: Problem 165
Got it. Thank you for replying.
“We have two lives, and the second begins when we realize we only have one.”
Confucius
Confucius
- SAG145
- Posts: 41
- Joined: Thu Apr 11, 2024 10:25 pm
Re: Problem 165
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
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
Last edited by SAG145 on Sat Nov 09, 2024 10:37 pm, edited 1 time in total.

-
whatteaux
- Posts: 12
- Joined: Mon Sep 24, 2012 11:58 am
- SAG145
- Posts: 41
- Joined: Thu Apr 11, 2024 10:25 pm