Skip to content

Instantly share code, notes, and snippets.

@timothy-shields
Created December 18, 2013 18:04
Show Gist options
  • Save timothy-shields/8026924 to your computer and use it in GitHub Desktop.
Save timothy-shields/8026924 to your computer and use it in GitHub Desktop.
int n = 11;
SortedSet<int> F = new SortedSet<int>();
while (true)
{
if (!F.Any() || F.Min > n)
{
F.Add(n);
n *= 11;
}
else
{
int m = F.Min;
F.Remove(m);
Console.WriteLine(m);
Console.ReadLine();
for (int j = 0; j <= 9; j++)
F.Add(int.Parse(m.ToString() + j.ToString()));
for (int j = 1; j <= 9; j++)
F.Add(int.Parse(j.ToString() + m.ToString()));
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment