Just enter any positive integer you want, and this program will show you all the consecutive sums that equal your number! Click the mode button to switch between modes. The first mode shows all the numbers in the series, the second mode shows the first number in the series, the last number, and the number of values in the series. The first mode is good for smaller numbers, the second mode is better for larger numbers. IMPORTANT: your number must be a positive integer. That is, a counting number greater than 0. Decimals will not work.
This project is based on Gauss's equation for the sum of consecutive integers from 1 to n. I played around with that equation and found that for any series of numbers, n=(-k^2+2x+k)/(2k) where n is the starting value of the consecutive series being summed, x is the sum itself, and k is the length of the series. The program inserts the value of your input for x, then it calculates n for the first 100,000 values of k. Whenever n is an integer, that is the beginning of a legitimate sum with length k.