Not sure what you want, but...
Have a look at example:
using System;
using System.Collections.Generic;
using System.Text;
namespace ConsoleApplication1
{
class Program
{
static void Main(string[] args)
{
List<int> Serials= new List<int>();
int tmpv =0;
for (int i = 96; i <= 202; i += 2)
{
tmpv = GetNextSN(i);
if(tmpv>0 && !Serials.Contains(i))
{
Serials.Add(tmpv);
}
Console.WriteLine("Current value: {0}; SN: {1}",i,tmpv);
}
Console.ReadKey();
}
static int GetNextSN(int currSN)
{
int rv = currSN;
if (rv <= 100)
return rv;
else
{
while (rv > 100)
{
rv -= 100;
}
if (rv>=1 && rv<=49)
rv = currSN;
else
rv = 0 ;
return rv;
}
}
}
}
Change the code to your needs.