https://github.com/derektypist/project-euler-041
An n-digit number is pandigital if it makes use of all the digits 1 to n exactly once. For example, 2143 is a 4-digit pandigital and is also prime. The aim is to find the largest n-length digit pandigital prime.
https://github.com/derektypist/project-euler-041
bootstrap5 css3 googlefonts html5 javascript
Last synced: 24 days ago
JSON representation
An n-digit number is pandigital if it makes use of all the digits 1 to n exactly once. For example, 2143 is a 4-digit pandigital and is also prime. The aim is to find the largest n-length digit pandigital prime.
- Host: GitHub
- URL: https://github.com/derektypist/project-euler-041
- Owner: derektypist
- Created: 2022-09-23T08:25:28.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2022-09-23T11:54:59.000Z (about 3 years ago)
- Last Synced: 2025-03-22T19:19:48.491Z (7 months ago)
- Topics: bootstrap5, css3, googlefonts, html5, javascript
- Language: JavaScript
- Homepage: https://derektypist.github.io/project-euler-041
- Size: 13.7 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Project Euler 041 - Pandigital Prime
We shall say that an n-digit number is pandigital if it makes use of all the digits 1 to n exactly once. For example, 2143 is a 4-digit pandigital and is also prime.
The aim is to find the largest n-length digit pandigital prime that exists, using HTML Forms and JavaScript.
Information at [Project Euler 041](https://projecteuler.net/problem=41)
## UX
**Getting Started**
Enter a whole number between 4 and 7, without leading zeros such as 04 and click on the Submit Button. You will see the largest pandigital prime, unless you have made an invalid input. Click on the Reset Button to clear the information or to start again.
**User Stories**
As a user, I get an error message, if I do any of:
- Not enter anything in the input field
- Entering text other than a number
- Entering a number less than 4 or greater than 7
- Including leading zeros such as 04
- Entering a number, but it is not an integerAs a user, I expect the function `pandigitalPrime(4)` to return a number.
As a user, I expect the function `pandigitalPrime(4)` to return 4231.
As a user, I expect the function `pandigitalPrime(7)` to return 7652413.
User stories on function `pandigitalPrime(n)` is taken from [FreeCodeCamp - Coding Interview Prep - Project Euler 041](https://www.freecodecamp.org/learn/coding-interview-prep/project-euler/problem-41-pandigital-prime)
**Information Architecture**
The function `pandigitalPrime(n)` returns a number, where n is a number between 4 and 7.
## Features
Allows the user to enter the number of digits in order to find the largest pandigital prime number of that number of digits. Performs checks on valid user input. If the input is not valid, an error message is displayed.
## Technologies
Uses HTML5, CSS3, JavaScript, Bootstrap 5.2.1 and Google Fonts.
## Testing
Ensure all user stories have been met.
## Deployment
Deployed on [GitHub Pages](https://derektypist.github.io/project-euler-041) at the main branch.
## Credits
### Content
Written by me.
### Acknowledgements
- [Project Euler](https://projecteuler.net)
- [FreeCodeCamp](https://www.freecodecamp.org)