Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
Maths solution in Clear category for Count Consecutive Summers by Alice_Parker-Louth
def count_consecutive_summers(num):
# your code here
#number of ways to express as sum of consecutive positive integers is equal to the number of odd factors that number has
odd_factors = []
x = 1
while x <= num:
if num % x ==0 and x % 2:
odd_factors.append(x)
x += 1
return len(odd_factors)
Oct. 24, 2019