Syncing two clocks on remote environments in a predictable way
<p>I don't have any mathematical background, so please excuse my language.</p>

<h1>motivation</h1>

<ul>
<li>Two different computers running a clock which is being reset to the same value (integer, i.e 1464009526876).</li>
<li>There will be no communication between the two computers from this moment forth</li>
<li>Due to various reasons, the two clocks will eventually go out of sync</li>
<li>I'm only interested in functions that specifically call for data from the clock, due to potential differences between the machines, there might be a different call number between the two</li>
<li>I don't care about the value itself</li>
<li>I do care for it to be <em>different</em> on each call, and overall having the <em>same</em> value on both ends</li>
<li>I am willing to sacrifice a certain amount of time in which this value won't change</li>
</ul>

<h1>problem</h1>

<p>Assuming two positive integers (a, b), which have a difference of no bigger than (d), which is a constant that can be decided upon beforehand.</p>

<p>The algorithm, accepting a single number(a|b) as an input, will output a new integer which is relative to both, hopefully placed somewhere between the two.</p>

<p>This integer will be the same for both, and basically all numbers within the defined range.</p>

<h2>example</h2>

<pre class="lang-java prettyprint-override"><code>a = 1464009526876;

b = 1464009514876;

alg(a); // output: 1464009526800

alg(b); // output: 1464009526800
</code></pre>

<p>My overall challenge is to sync the two numbers, and try to generate values that are different, yet somewhat close to the initial reset value and/or the average/relative time passed.</p>

<p>Using <a href="https://en.wikipedia.org/wiki/Network_Time_Protocol" rel="nofollow">NTP</a> won't cut it due to its need to <a href="https://en.wikipedia.org/wiki/Network_Time_Protocol#Clock_synchronization_algorithm" rel="nofollow">poll</a> for the data (also, as mentioned before, I don't care about the value itself, just for it to be identical and relative to the original reset value).</p>