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 n prime value family.
Information at Project Euler 051
Getting Started
Select the Show Solution button to Show the Solution. Select the Hide Solution button to Hide the Solution.
User Stories
As a user, I can show or hide the solution by selecting the appropriate button.
As a user, I expect the function primeDigitReplacements(6)
to return a number.
As a user, I expect the function primeDigitReplacements(6)
to return 13.
As a user, I expect the function primeDigitReplacements(7)
to return 56003.
As a user, I expect the function primeDigitReplacements(8)
to return 121313.
User Stories on function primeDigitReplacements(n)
taken from FreeCodeCamp - Coding Interview Prep - Project Euler 051
Information Architecture
The function primeDigitReplacements(n)
returns a number, where n
is a number.
Allows the user to show or hide the solution to the problem as described in Project Euler 051.
Uses HTML5, CSS3, JavaScript, Bootstrap 5.2.2 and Google Fonts.
Ensure all user stories have been met.
Deployed on GitHub Pages at the main branch.
PrimeSieve class
in script.js
taken from FreeCodeCamp on GitHub, accessed on 29 October 2022.