An institutional block execution desk at Citadel must slice a large parent order of shares into discrete tranches of consecutive increasing lot sizes: , where the initial lot size and the tranche count are both positive integers ().
For example, an order of shares can be sliced in different ways:
Your Task
Implement the function consecutive_numbers_sum(n: int) -> int that calculates the total number of ways to express as the sum of consecutive positive integers in time.
Constraints
Examples
consecutive_numbers_sum(5) # returns 2 (5, 2+3)
consecutive_numbers_sum(9) # returns 3 (9, 4+5, 2+3+4)
consecutive_numbers_sum(15) # returns 4