Skip to content

nsylv/politeness

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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/

About

Compute the politeness of a number

Resources

License

Stars

Watchers

Forks

Packages

No packages published