56 lines
		
	
	
		
			1.4 KiB
		
	
	
	
		
			Markdown
		
	
	
	
	
	
			
		
		
	
	
			56 lines
		
	
	
		
			1.4 KiB
		
	
	
	
		
			Markdown
		
	
	
	
	
	
| ---
 | |
| id: 5900f53d1000cf542c51004f
 | |
| challengeType: 5
 | |
| title: 'Problem 464: Möbius function and intervals'
 | |
| videoUrl: ''
 | |
| localeTitle: 'Problema 464: Función de Möbius e intervalos.'
 | |
| ---
 | |
| 
 | |
| ## Description
 | |
| <section id="description"> La función de Möbius, denotada μ (n), se define como: μ (n) = (-1) ω (n) si n es squarefree (donde ω (n) es el número de factores primos distintos de n) μ (n ) = 0 si n no es squarefree. <p> Sea P (a, b) el número de enteros n en el intervalo [a, b] tal que μ (n) = 1. Sea N (a, b) el número de enteros n en el intervalo [a, b ] tal que μ (n) = -1. Por ejemplo, P (2,10) = 2 y N (2,10) = 4. </p><p> Sea C (n) el número de pares de enteros (a, b) de manera que: 1 ≤ a ≤ b ≤ n, 99 · N (a, b) ≤ 100 · P (a, b), y 99 · P ( a, b) ≤ 100 · N (a, b). </p><p> Por ejemplo, C (10) = 13, C (500) = 16676 y C (10 000) = 20155319. </p><p> Encontrar C (20 000 000). </p></section>
 | |
| 
 | |
| ## Instructions
 | |
| <section id="instructions">
 | |
| </section>
 | |
| 
 | |
| ## Tests
 | |
| <section id='tests'>
 | |
| 
 | |
| ```yml
 | |
| tests:
 | |
|   - text: <code>euler464()</code> debe devolver 198775297232878.
 | |
|     testString: 'assert.strictEqual(euler464(), 198775297232878, "<code>euler464()</code> should return 198775297232878.");'
 | |
| 
 | |
| ```
 | |
| 
 | |
| </section>
 | |
| 
 | |
| ## Challenge Seed
 | |
| <section id='challengeSeed'>
 | |
| 
 | |
| <div id='js-seed'>
 | |
| 
 | |
| ```js
 | |
| function euler464() {
 | |
|   // Good luck!
 | |
|   return true;
 | |
| }
 | |
| 
 | |
| euler464();
 | |
| 
 | |
| ```
 | |
| 
 | |
| </div>
 | |
| 
 | |
| 
 | |
| 
 | |
| </section>
 | |
| 
 | |
| ## Solution
 | |
| <section id='solution'>
 | |
| 
 | |
| ```js
 | |
| // solution required
 | |
| ```
 | |
| </section>
 |