An open API service indexing awesome lists of open source software.

https://github.com/derektypist/project-euler-044

Pentagonal Numbers are generated by the formula Pn = n(3n-1)/2. The first ten pentagonal numbers are 1, 5, 12, 22, 35, 51, 70, 92, 117, 145. The aim is to find the pair of pentagonal numbers, Pj and Pk , for which their sum and difference is pentagonal and D = |Pk - Pj| is minimised. Find the value of D.
https://github.com/derektypist/project-euler-044

bootstrap5 css3 google-fonts html5 javascript project-euler

Last synced: about 2 months ago
JSON representation

Pentagonal Numbers are generated by the formula Pn = n(3n-1)/2. The first ten pentagonal numbers are 1, 5, 12, 22, 35, 51, 70, 92, 117, 145. The aim is to find the pair of pentagonal numbers, Pj and Pk , for which their sum and difference is pentagonal and D = |Pk - Pj| is minimised. Find the value of D.

Awesome Lists containing this project

README

          

# Project Euler 044 - Pentagon Numbers

Pentagonal numbers are generated by the formula, Pn = n(3n-1)/2. The first ten
pentagonal numbers are:

1, 5, 12, 22, 35, 51, 70, 92, 117, 145, ...

It can be seen that P4 + P7 = 22 + 70 = 92 = P8. However,
their difference is not pentagonal.

Find the pair of pentagonal numbers, Pj and Pk, for which their sum and difference are pentagonal and D = |Pk - Pj| is minimised, what is the value of D.

Information at [Project Euler 044](https://projecteuler.net/problem=44)

## UX

**Getting Started**

Click on the Show Solution button to show the solution. Click on the Hide Solution button to hide the solution.

**User Stories**

As a user, I can get the solution to be shown or hidden.

As a user, I expect the function `pentagonNumbers()` to return a number.

As a user, I expect the function `pentagonNumbers()` to return 5482660.

User Stories on function `pentagonNumbers()` is taken from [FreeCodeCamp - Coding Interview Prep - Project Euler 044](https://www.freecodecamp.org/learn/coding-interview-prep/project-euler/problem-44-pentagon-numbers)

**Information Architecture**

The function `pentagonNumbers()` returns a number.

## Features

Allows the user to show or hide the solution to the problem as described in [Project Euler 044](https://projecteuler.net/problem=44).

## Technologies

Uses HTML5, CSS3, JavaScript, Bootstrap 5.2.2 and Google Fonts.

## Testing

Ensure all user stories have been met.

## Deployment

Deployed on [GitHub Pages](https://derektypist.github.io/project-euler-044) at the main branch.

## Credits

### Content

Written by me.

### Acknowledgements

- [Project Euler](https://www.projecteuler.net)
- [FreeCodeCamp](https://www.freecodecamp.org)