http://www.monthly-hack.com/entry/2017/03/03/171543
o = s(i - 1) + k - 2p