Skip to content

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.

Notifications You must be signed in to change notification settings

derektypist/project-euler-044

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 

Repository files navigation

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

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

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.

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 at the main branch.

Credits

Content

Written by me.

Acknowledgements

About

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.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published