I have a random number (eg 455,835
). Starting from 615
downwards I would like to calculate when the two integers average changing.
For example. I know that 603
and 755
's average is 679
. How can I calculate it with an equation that the next change will happen at 598
?
I can only work with natural numbers. Rational numbers are not allowed.
Edit: Clarification from eyeballfrog:
So the idea is you have some arbitrary number N choose various x<N. You calculate another number y=⌊N/x⌋, then take the truncated average ⌊(x+y)/2⌋, and want to know when that average changes.
Sample