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