31 + 32 + 33 + ... + n = 4585
=> [(n - 31) : 1 + 1] x (31 + n) : 2 = 4585
=> (n - 30) x (n + 31) = 4585 x 2
=> (n - 30) x (n + 31) = 9170
=> n x n + 31 x n - 30 x n - 30 x 31 = 9170
=> n x n + n - 930 = 9170
=> n x n + n = 10100
=> n x (n + 1) = 10100
=> n x (n + 1) = 100 x 101
=> n = 100