using System.Collections.Generic;
private static HashSet<ushort> indexSet;
public static void Main()
indexSet = new HashSet<ushort>();
var timer = new System.Diagnostics.Stopwatch();
Console.WriteLine(string.Format("{0}", timer.ElapsedMilliseconds / 1000f));
Console.WriteLine(string.Format("{0} {1}", FindNext(), timer.ElapsedMilliseconds / 1000f));
Console.WriteLine(string.Format("{0} {1}", FindNext(), timer.ElapsedMilliseconds / 1000f));
private static ushort FindNext() {
while(!indexSet.Add(++index)) {