/project-euler-045

Triangle Numbers are generated by the formula Tn = n(n+1)/2 - Its numbers are 1, 3, 6, 10, 15,.... Pentagonal Numbers are generated by the formula Pn = n(3n-1)/2 - Its numbers are 1, 5, 12, 22, 35,.... Hexagonal numbers are generated by the formula Hn = n(2n-1) - Its numbers are 1, 6, 15, 28, 45,.... It can be verified that T285 = P165 = H143 = 40755. Find the next triangle number that is also pentagonal and hexagonal.

Primary LanguageHTML

Project Euler 045 - Triangular, Pentagonal and Hexagonal

Triangle, Pentagonal and Hexagonal numbers are generated by the following formulae:

Triangle Tn=n(n+1)/2 generates the numbers 1, 3, 6, 10, 15,...

Pentagonal Pn=n(3n-1)/2 generates the numbers 1, 5, 12, 22, 35,..

Hexagonal Hn=n(2n-1) generates the numbers 1, 6, 15, 28, 45,...

It can be verified that T285 = P165 = H143 = 40755

Find the next triangle number that is also pentagonal and hexagonal.

Information at Project Euler 045

UX

Getting Started

Click on the Show Solution to show the solution. Click on the Hide Solution 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 triPentaHexa(40756) to return a number.

As a user, I expect the function triPentaHexa(40756) to return 1533776805.

User Stories on function triPentaHexa(n) taken from FreeCodeCamp - Coding Interview Prep - Project Euler 045

Information Architecture

The function triPentaHexa(n) returns a number, where n is a number.

Features

Allows the user to show or hide the solution to the problem as described in Project Euler 045.

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