Files
freeCodeCamp/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-51-prime-digit-replacements.english.md
Kristofer Koishigawa 6cfd0fc503 fix: improve Project Euler descriptions, challenge seeds, and test cases (#38016)
* fix: improve Project Euler descriptions and test case

Improve formatting of Project Euler test descriptions. Also add poker hands array and new test case for problem 54

* feat: add typeof tests and gave functions proper names for first 100 challenges

* fix: continue fixing test descriptions and adding "before test" sections

* fix: address review comments

* fix: adjust grids in 18 and 67 and fix some text that reference files rather than the given arrays

* fix: implement bug fixes and improvements from review

* fix: remove console.log statements from seed and solution
2020-02-28 06:39:47 -06:00

1.5 KiB

id, challengeType, title, forumTopicId
id challengeType title forumTopicId
5900f39f1000cf542c50feb2 5 Problem 51: Prime digit replacements 302162

Description

By replacing the 1st digit of the 2-digit number *3, it turns out that six of the nine possible values: 13, 23, 43, 53, 73, and 83, are all prime.

By replacing the 3rd and 4th digits of 56**3 with the same digit, this 5-digit number is the first example having seven primes among the ten generated numbers, yielding the family: 56003, 56113, 56333, 56443, 56663, 56773, and 56993. Consequently 56003, being the first member of this family, is the smallest prime with this property.

Find the smallest prime which, by replacing part of the number (not necessarily adjacent digits) with the same digit, is part of an eight prime value family.

Instructions

Tests

tests:
  - text: <code>primeDigitReplacements()</code> should return a number.
    testString: assert(typeof primeDigitReplacements() === 'number');
  - text: <code>primeDigitReplacements()</code> should return 121313.
    testString: assert.strictEqual(primeDigitReplacements(), 121313);

Challenge Seed

function primeDigitReplacements() {
  // Good luck!
  return true;
}

primeDigitReplacements();

Solution

// solution required