0:00:06.720,0:00:10.354 Your rich, eccentric uncle [br]just passed away, 0:00:10.354,0:00:16.854 and you and your 99 nasty relatives have[br]been invited to the reading of his will. 0:00:16.854,0:00:19.374 He wanted to leave [br]all of his money to you, 0:00:19.374,0:00:24.805 but he knew that if he did,[br]your relatives would pester you forever. 0:00:24.805,0:00:27.062 So he is banking on the fact 0:00:27.062,0:00:32.660 that he taught you everything [br]you need to know about riddles. 0:00:32.660,0:00:35.558 Your uncle left the following [br]note in his will: 0:00:35.558,0:00:37.777 "I have created a puzzle. 0:00:37.777,0:00:42.028 If all 100 of you answer it together,[br]you will share the money evenly. 0:00:42.028,0:00:46.185 However, if you are the first to find[br]the pattern and solve the problem 0:00:46.185,0:00:48.721 without going through all of the leg work, 0:00:48.721,0:00:52.521 you will get the entire inheritance [br]all to yourself. 0:00:52.521,0:00:54.098 Good luck." 0:00:54.098,0:00:58.929 The lawyer takes you and your 99 relatives[br]to a secret room in the mansion 0:00:58.929,0:01:01.795 that contains 100 lockers, 0:01:01.795,0:01:04.270 each hiding a single word. 0:01:04.270,0:01:05.440 He explains: 0:01:05.440,0:01:09.805 Every relative is assigned a number[br]from 1 to 100. 0:01:09.805,0:01:12.705 Heir 1 will open every locker. 0:01:12.705,0:01:16.702 Heir 2 will then [br]close every second locker. 0:01:16.702,0:01:20.879 Heir 3 will change the status[br]of every third locker, 0:01:20.879,0:01:23.775 specifically if it's open, [br]she'll close it, 0:01:23.775,0:01:26.580 but if it's closed, she'll open it. 0:01:26.580,0:01:31.179 This pattern will continue until[br]all 100 of you have gone. 0:01:31.179,0:01:34.462 The words in the lockers that remain[br]open at the end 0:01:34.462,0:01:38.037 will help you crack the code for the safe. 0:01:38.037,0:01:42.644 Before Cousin Thaddeus can even start[br]down the line, 0:01:42.644,0:01:49.012 you step forward and tell the lawyer[br]you know which lockers will remain open. 0:01:49.012,0:01:51.366 But how? 0:01:51.366,0:01:54.332 Pause the video now if you want[br]to figure it out for yourself! 0:01:54.332,0:01:55.421 Answer in: 3 0:01:55.421,0:01:56.577 Answer in: 2 0:01:56.577,0:01:58.248 Answer in: 1 0:01:58.248,0:02:02.151 The key is realizing that the number[br]of times a locker is touched 0:02:02.151,0:02:06.427 is the same as the number of factors[br]in the locker number. 0:02:06.427,0:02:09.064 For example, in locker #6, 0:02:09.064,0:02:10.708 Person 1 will open it, 0:02:10.708,0:02:12.602 Person 2 will close it, 0:02:12.602,0:02:14.316 Person 3 will open it, 0:02:14.316,0:02:17.212 and Person 6 will close it. 0:02:17.212,0:02:22.332 The numbers 1, 2, 3, and 6 [br]are the factors of 6. 0:02:22.332,0:02:25.165 So when a locker has an even number[br]of factors 0:02:25.165,0:02:26.812 it will remain closed, 0:02:26.812,0:02:28.833 and when it has an odd number of factors, 0:02:28.833,0:02:30.962 it will remain open. 0:02:30.962,0:02:33.953 Most of the lockers [br]have an even number of factors, 0:02:33.953,0:02:37.713 which makes sense because factors[br]naturally pair up. 0:02:37.713,0:02:41.475 In fact, the only lockers that have[br]an odd number of factors 0:02:41.475,0:02:43.774 are perfect squares 0:02:43.774,0:02:48.952 because those have one factor that when[br]multiplied by itself equals the number. 0:02:48.952,0:02:51.334 For Locker 9, 1 will open it, 0:02:51.334,0:02:52.818 3 will close, 0:02:52.818,0:02:54.934 and 9 will open it. 0:02:54.934,0:02:57.094 3 x 3 = 9, 0:02:57.094,0:02:59.379 but the 3 can only be counted once. 0:02:59.379,0:03:04.529 Therefore, every locker that is [br]a perfect square will remain open. 0:03:04.529,0:03:07.426 You know that these ten lockers [br]are the solution, 0:03:07.426,0:03:11.285 so you open them immediately[br]and read the words inside: 0:03:11.285,0:03:17.043 "The code is the first five lockers[br]touched only twice." 0:03:17.043,0:03:21.881 You realize that the only lockers [br]touched twice have to be prime numbers 0:03:21.881,0:03:24.454 since each only has two factors: 0:03:24.454,0:03:26.508 1 and itself. 0:03:26.508,0:03:30.835 So the code is 2,3,5,7,11. 0:03:30.835,0:03:33.209 The lawyer brings you to the safe, 0:03:33.209,0:03:35.045 and you claim your inheritance. 0:03:35.045,0:03:38.527 Too bad your relatives were always[br]too busy being nasty to each other 0:03:38.527,0:03:41.344 to pay attention [br]to your eccentric uncle's riddles.