66 lines
		
	
	
		
			1.8 KiB
		
	
	
	
		
			Markdown
		
	
	
	
	
	
		
		
			
		
	
	
			66 lines
		
	
	
		
			1.8 KiB
		
	
	
	
		
			Markdown
		
	
	
	
	
	
| 
								 | 
							
								---
							 | 
						|||
| 
								 | 
							
								id: 5900f38f1000cf542c50fea2
							 | 
						|||
| 
								 | 
							
								challengeType: 5
							 | 
						|||
| 
								 | 
							
								title: 'Problem 35: Circular primes'
							 | 
						|||
| 
								 | 
							
								videoUrl: ''
							 | 
						|||
| 
								 | 
							
								localeTitle: 问题35:循环素数
							 | 
						|||
| 
								 | 
							
								---
							 | 
						|||
| 
								 | 
							
								
							 | 
						|||
| 
								 | 
							
								## Description
							 | 
						|||
| 
								 | 
							
								<section id="description">这个数字197被称为循环素数,因为数字的所有旋转:197,971和719本身都是素数。在100:2,3,5,7,11,13,17,31,37,71,73,79和97之下有十三个这样的素数。在n下面有多少个圆形素数,而100 <= n < = 1000000? </section>
							 | 
						|||
| 
								 | 
							
								
							 | 
						|||
| 
								 | 
							
								## Instructions
							 | 
						|||
| 
								 | 
							
								<section id="instructions">
							 | 
						|||
| 
								 | 
							
								</section>
							 | 
						|||
| 
								 | 
							
								
							 | 
						|||
| 
								 | 
							
								## Tests
							 | 
						|||
| 
								 | 
							
								<section id='tests'>
							 | 
						|||
| 
								 | 
							
								
							 | 
						|||
| 
								 | 
							
								```yml
							 | 
						|||
| 
								 | 
							
								tests:
							 | 
						|||
| 
								 | 
							
								  - text: <code>circularPrimes(100)</code>应该返回13。
							 | 
						|||
| 
								 | 
							
								    testString: 'assert(circularPrimes(100) == 13, "<code>circularPrimes(100)</code> should return 13.");'
							 | 
						|||
| 
								 | 
							
								  - text: <code>circularPrimes(100000)</code>应该返回43。
							 | 
						|||
| 
								 | 
							
								    testString: 'assert(circularPrimes(100000) == 43, "<code>circularPrimes(100000)</code> should return 43.");'
							 | 
						|||
| 
								 | 
							
								  - text: <code>circularPrimes(250000)</code>应该返回45。
							 | 
						|||
| 
								 | 
							
								    testString: 'assert(circularPrimes(250000) == 45, "<code>circularPrimes(250000)</code> should return 45.");'
							 | 
						|||
| 
								 | 
							
								  - text: <code>circularPrimes(500000)</code>应该返回49。
							 | 
						|||
| 
								 | 
							
								    testString: 'assert(circularPrimes(500000) == 49, "<code>circularPrimes(500000)</code> should return 49.");'
							 | 
						|||
| 
								 | 
							
								  - text: <code>circularPrimes(750000)</code>应该返回49。
							 | 
						|||
| 
								 | 
							
								    testString: 'assert(circularPrimes(750000) == 49, "<code>circularPrimes(750000)</code> should return 49.");'
							 | 
						|||
| 
								 | 
							
								  - text: <code>circularPrimes(1000000)</code>应该返回55。
							 | 
						|||
| 
								 | 
							
								    testString: 'assert(circularPrimes(1000000) == 55, "<code>circularPrimes(1000000)</code> should return 55.");'
							 | 
						|||
| 
								 | 
							
								
							 | 
						|||
| 
								 | 
							
								```
							 | 
						|||
| 
								 | 
							
								
							 | 
						|||
| 
								 | 
							
								</section>
							 | 
						|||
| 
								 | 
							
								
							 | 
						|||
| 
								 | 
							
								## Challenge Seed
							 | 
						|||
| 
								 | 
							
								<section id='challengeSeed'>
							 | 
						|||
| 
								 | 
							
								
							 | 
						|||
| 
								 | 
							
								<div id='js-seed'>
							 | 
						|||
| 
								 | 
							
								
							 | 
						|||
| 
								 | 
							
								```js
							 | 
						|||
| 
								 | 
							
								function circularPrimes(n) {
							 | 
						|||
| 
								 | 
							
								  // Good luck!
							 | 
						|||
| 
								 | 
							
								  return n;
							 | 
						|||
| 
								 | 
							
								}
							 | 
						|||
| 
								 | 
							
								
							 | 
						|||
| 
								 | 
							
								circularPrimes(1000000);
							 | 
						|||
| 
								 | 
							
								
							 | 
						|||
| 
								 | 
							
								```
							 | 
						|||
| 
								 | 
							
								
							 | 
						|||
| 
								 | 
							
								</div>
							 | 
						|||
| 
								 | 
							
								
							 | 
						|||
| 
								 | 
							
								
							 | 
						|||
| 
								 | 
							
								
							 | 
						|||
| 
								 | 
							
								</section>
							 | 
						|||
| 
								 | 
							
								
							 | 
						|||
| 
								 | 
							
								## Solution
							 | 
						|||
| 
								 | 
							
								<section id='solution'>
							 | 
						|||
| 
								 | 
							
								
							 | 
						|||
| 
								 | 
							
								```js
							 | 
						|||
| 
								 | 
							
								// solution required
							 | 
						|||
| 
								 | 
							
								```
							 | 
						|||
| 
								 | 
							
								</section>
							 |