{"id":24740382,"url":"https://github.com/derektypist/project-euler-027","last_synced_at":"2026-05-10T19:34:57.954Z","repository":{"id":39893919,"uuid":"507255617","full_name":"derektypist/project-euler-027","owner":"derektypist","description":"Find the product of the coefficients a and b, for the quadratic expression that produces the maximum number of primes for consecutive values of n, starting with n=0.  In the form of (n*n) + an + b.","archived":false,"fork":false,"pushed_at":"2022-06-25T10:55:12.000Z","size":18,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-01-27T23:24:44.704Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://derektypist.github.io/project-euler-027","language":"HTML","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/derektypist.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-06-25T08:24:33.000Z","updated_at":"2022-06-25T11:01:18.000Z","dependencies_parsed_at":"2022-08-30T21:40:09.936Z","dependency_job_id":null,"html_url":"https://github.com/derektypist/project-euler-027","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/derektypist%2Fproject-euler-027","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/derektypist%2Fproject-euler-027/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/derektypist%2Fproject-euler-027/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/derektypist%2Fproject-euler-027/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/derektypist","download_url":"https://codeload.github.com/derektypist/project-euler-027/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245007885,"owners_count":20546241,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-01-27T23:23:11.313Z","updated_at":"2026-05-10T19:34:52.934Z","avatar_url":"https://github.com/derektypist.png","language":"HTML","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Project Euler 027 - Quadratic Primes\n\nEuler discovered the remarkable quadratic formula:\n\n    (n*n) + n + 41\n\nIt turns out that the formula will produce 40 primes for the consecutive integer values n = 0 to 39.  However, when n is 40, (40x40) + 40 + 41 = (40)(40+1) + 41 is divisible by 41, and certainly when n = 41, (41x41) + 41 + 41 is clearly divisible by 41.\n\nThe incredible formula, (n*n) - 79n + 1601 was discovered, which produces 80 primes for the consecutive values n = 0 to 79.  The product of the coefficients, -79 and 1601 is -126479.\n\nConsidering quadratics of the form:\n\n    (n*n) + an + b, where |a| is less than 1000 and |b| is less than or equal to 1000.\n    \n    Where |n| is the modulus/absolute value of n, e.g. |11| = 11, |-4| = 4.\n\nThe aim is to find the product of the coefficients, a and b, for the quadratic expression that produces the maximum number of primes for consecutive values of n, starting with n = 0.\n\nInformation at [Project Euler 027](https://projecteuler.net/problem=27)\n\n## UX\n\n**Getting Started**\n\nEnter a whole number between 2 and 1000 in the input field and click on the Submit Button.  You will see the product of the coefficient of a and b that produces the maximum primes for consecutive values of n, starting with n = 0.  For example, if you entered 200, you would expect to get -4925.  Except when you have made an invalid input.  Click on the Reset Button to clear the information or to start again.\n\n**User Stories**\n\nAs a user, I expect to get an error message, if I do any of:\n\n- Not enter anything in the input field\n- Entering text other than a number\n- Entering a number less than 2 or greater than 1000\n- Entering a number but it is not an integer\n\nAs a user, I expect the function `quadraticPrimes(200)` to return a number.\n\nAs a user, I expect the function `quadraticPrimes(200)` to return -4925.\n\nAs a user, I expect the function `quadraticPrimes(500)` to return -18901.\n\nAs a user, I expect the function `quadraticPrimes(800)` to return -43835.\n\nAs a user, I expect the function `quadraticPrimes(1000)` to return -59231.\n\n**Information Architecture**\n\nThe function `quadraticPrimes(range)` returns a number, where `range` is a number between 2 and 1000.\n\n## Features\n\nAllows the user to enter a number (range) as well as getting the product of the coefficients of a and b that produces the maximum number of primes for consecutive values of n, starting with n = 0.  Performs checks on valid user input.  If the input is not valid, an error message is displayed.\n\n## Technologies\n\nUses HTML5, CSS3, JavaScript, Google Fonts and Bootstrap 5.2.0-Beta1.\n\n## Testing\n\nEnsure all user stories have been met.\n\n## Deployment\n\nDeployed on [GitHub Pages](https://derektypist.github.io/project-euler-027) at the main branch.\n\n## Credits\n\n### Content\n\nWritten by me.\n\n### Acknowledgements\n\n- [Project Euler](https://projecteuler.net)\n- [FreeCodeCamp](https://www.freecodecamp.org)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fderektypist%2Fproject-euler-027","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fderektypist%2Fproject-euler-027","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fderektypist%2Fproject-euler-027/lists"}