| 
									
										
										
										
											2018-09-30 23:01:58 +01:00
										 |  |  | --- | 
					
						
							|  |  |  | id: 5900f5241000cf542c510036 | 
					
						
							|  |  |  | challengeType: 5 | 
					
						
							| 
									
										
										
										
											2020-05-21 17:31:25 +02:00
										 |  |  | isHidden: false | 
					
						
							| 
									
										
										
										
											2018-09-30 23:01:58 +01:00
										 |  |  | title: 'Problem 437: Fibonacci primitive roots' | 
					
						
							| 
									
										
										
										
											2019-08-05 09:17:33 -07:00
										 |  |  | forumTopicId: 302108 | 
					
						
							| 
									
										
										
										
											2018-09-30 23:01:58 +01:00
										 |  |  | --- | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | ## Description
 | 
					
						
							|  |  |  | <section id='description'> | 
					
						
							|  |  |  | When we calculate 8n modulo 11 for n=0 to 9 we get: 1, 8, 9, 6, 4, 10, 3, 2, 5, 7. | 
					
						
							|  |  |  | As we see all possible values from 1 to 10 occur. So 8 is a primitive root of 11. | 
					
						
							|  |  |  | But there is more: | 
					
						
							|  |  |  | If we take a closer look we see: | 
					
						
							|  |  |  | 1+8=9 | 
					
						
							|  |  |  | 8+9=17≡6 mod 11 | 
					
						
							|  |  |  | 9+6=15≡4 mod 11 | 
					
						
							|  |  |  | 6+4=10 | 
					
						
							|  |  |  | 4+10=14≡3 mod 11 | 
					
						
							|  |  |  | 10+3=13≡2 mod 11 | 
					
						
							|  |  |  | 3+2=5 | 
					
						
							|  |  |  | 2+5=7 | 
					
						
							|  |  |  | 5+7=12≡1 mod 11. | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | So the powers of 8 mod 11 are cyclic with period 10, and 8n + 8n+1 ≡ 8n+2 (mod 11). | 
					
						
							|  |  |  | 8 is called a Fibonacci primitive root of 11. | 
					
						
							|  |  |  | Not every prime has a Fibonacci primitive root. | 
					
						
							|  |  |  | There are 323 primes less than 10000 with one or more Fibonacci primitive roots and the sum of these primes is 1480491. | 
					
						
							|  |  |  | Find the sum of the primes less than 100,000,000 with at least one Fibonacci primitive root. | 
					
						
							|  |  |  | </section> | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | ## Instructions
 | 
					
						
							|  |  |  | <section id='instructions'> | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | </section> | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | ## Tests
 | 
					
						
							|  |  |  | <section id='tests'> | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | ```yml | 
					
						
							| 
									
										
										
										
											2018-10-04 14:37:37 +01:00
										 |  |  | tests: | 
					
						
							|  |  |  |   - text: <code>euler437()</code> should return 74204709657207. | 
					
						
							| 
									
										
										
										
											2019-07-26 19:41:55 -07:00
										 |  |  |     testString: assert.strictEqual(euler437(), 74204709657207); | 
					
						
							| 
									
										
										
										
											2018-09-30 23:01:58 +01:00
										 |  |  | 
 | 
					
						
							|  |  |  | ``` | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | </section> | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | ## Challenge Seed
 | 
					
						
							|  |  |  | <section id='challengeSeed'> | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | <div id='js-seed'> | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | ```js | 
					
						
							|  |  |  | function euler437() { | 
					
						
							|  |  |  |   // Good luck! | 
					
						
							|  |  |  |   return true; | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | euler437(); | 
					
						
							|  |  |  | ``` | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | </div> | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | </section> | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | ## Solution
 | 
					
						
							|  |  |  | <section id='solution'> | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | ```js | 
					
						
							|  |  |  | // solution required | 
					
						
							|  |  |  | ``` | 
					
						
							| 
									
										
										
										
											2019-07-18 08:24:12 -07:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-09-30 23:01:58 +01:00
										 |  |  | </section> |