| 
									
										
										
										
											2018-10-10 18:03:03 -04:00
										 |  |  |  | --- | 
					
						
							|  |  |  |  | id: 5900f3ec1000cf542c50fefe | 
					
						
							| 
									
										
										
										
											2021-02-06 04:42:36 +00:00
										 |  |  |  | title: 'Problem 127: abc-hits' | 
					
						
							| 
									
										
										
										
											2018-10-10 18:03:03 -04:00
										 |  |  |  | challengeType: 5 | 
					
						
							| 
									
										
										
										
											2021-02-06 04:42:36 +00:00
										 |  |  |  | forumTopicId: 301754 | 
					
						
							| 
									
										
										
										
											2021-01-13 03:31:00 +01:00
										 |  |  |  | dashedName: problem-127-abc-hits | 
					
						
							| 
									
										
										
										
											2018-10-10 18:03:03 -04:00
										 |  |  |  | --- | 
					
						
							|  |  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-12-16 00:37:30 -07:00
										 |  |  |  | # --description--
 | 
					
						
							| 
									
										
										
										
											2018-10-10 18:03:03 -04:00
										 |  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-02-06 04:42:36 +00:00
										 |  |  |  | The radical of n, rad(n), is the product of distinct prime factors of n. For example, 504 = 23 × 32 × 7, so rad(504) = 2 × 3 × 7 = 42. | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  | We shall define the triplet of positive integers (a, b, c) to be an abc-hit if: | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  | GCD(a, b) = GCD(a, c) = GCD(b, c) = 1 | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  | a < b | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  | a + b = c | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  | rad(abc) < c | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  | For example, (5, 27, 32) is an abc-hit, because: | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  | GCD(5, 27) = GCD(5, 32) = GCD(27, 32) = 1 | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  | 5 < 27 | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  | 5 + 27 = 32 | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  | rad(4320) = 30 < 32 | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  | It turns out that abc-hits are quite rare and there are only thirty-one abc-hits for c < 1000, with ∑c = 12523. | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  | Find ∑c for c < 120000. | 
					
						
							| 
									
										
										
										
											2018-10-10 18:03:03 -04:00
										 |  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-12-16 00:37:30 -07:00
										 |  |  |  | # --hints--
 | 
					
						
							| 
									
										
										
										
											2018-10-10 18:03:03 -04:00
										 |  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-02-06 04:42:36 +00:00
										 |  |  |  | `euler127()` should return 18407904. | 
					
						
							| 
									
										
										
										
											2018-10-10 18:03:03 -04:00
										 |  |  |  | 
 | 
					
						
							|  |  |  |  | ```js | 
					
						
							| 
									
										
										
										
											2020-12-16 00:37:30 -07:00
										 |  |  |  | assert.strictEqual(euler127(), 18407904); | 
					
						
							| 
									
										
										
										
											2018-10-10 18:03:03 -04:00
										 |  |  |  | ``` | 
					
						
							|  |  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-01-13 03:31:00 +01:00
										 |  |  |  | # --seed--
 | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  | ## --seed-contents--
 | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  | ```js | 
					
						
							|  |  |  |  | function euler127() { | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |   return true; | 
					
						
							|  |  |  |  | } | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  | euler127(); | 
					
						
							|  |  |  |  | ``` | 
					
						
							|  |  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-12-16 00:37:30 -07:00
										 |  |  |  | # --solutions--
 | 
					
						
							| 
									
										
										
										
											2020-08-13 17:24:35 +02:00
										 |  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-01-13 03:31:00 +01:00
										 |  |  |  | ```js | 
					
						
							|  |  |  |  | // solution required | 
					
						
							|  |  |  |  | ``` |