Answers (2)
Your question reads, as if you wanted to ask, "[S]even consecutive integers are added [up]. [...] Which integer meets both conditions?"
Let's be inventive and call the desired number n.
1st condition: n := maximum (sequence: [k-6 , k-5 , k-4 , ... , k-1 , k] ); k € N
.... Obviously n := k, due to our skilfully arranged sequence. We'll immediately
.... apply that in the next step:
2nd condition: n:= (sum (sequence: [n-6 , n-5 , n-4 , ... , n-1 , n] )) / 6
.... n = (n-6 + n-5 + n-4 + ... + n) / 6
.... n = ((7n) - 6 - 5 - 4 - 3 - 2 - 1) / 6
.... n = ((7n) - (6 + 5 + 4 + 3 + 2 + 1)) / 6
............. sum ( - (6 + 5 + 4 + 3 + 2 + 1))
............. - sum (6 + 5 + 4 + 3 + 2 + 1)
............. If you don't want to iterate over this sequence, then apply the
............. corresponding function to the sequence: sum (1 to k) = (k * (k + 1)) / 2.
............. For k = 6 it returns 21.
Finally, we put it all together:
n = (7n - 21) / 6
6n = 7n - 21
n = 21
Hence, the sequence is: [15, 16, 17, 18, 19, 20, 21]
Test:
maximum (sum [15, 16, 17, 18, 19, 20, 21] => 126) / 6 = 21.