1.0.0 • Published 4 years ago

politeness v1.0.0

Weekly downloads
2
License
MIT
Repository
github
Last release
4 years ago

Compute the politeness of a number.

CI/CD codecov License

Politeness

The politeness of a number is teh number of ways it can be expressed as the sum of consecutive integers.

Example

The politeness of 15 is 3.

There are only three ways to express 15 as the sum of consecutive integers:

  • 15 = 1 + 2 + 3 + 4 + 5
  • 15 = 4 + 5 + 6
  • 15 = 7 + 8

Reference

https://www.geeksforgeeks.org/find-politeness-number/