Hey!Mike Arney this is a good try. I have tried various algorithms in my experience and have never come across anything as efficient as this. However, the Math behind this was not adding up for me.
Therefore i went to http://mathforum.org/dr.math/ & Thanks To Dr Peterson who confirmed that this formula is invalid.
Try to use your algorithm for any of the below sequence.
1, 14
Or, if you prefer,
1, 3, 5, 6
Cheers!
Chinkit