Anonymous     Text only     06 May 2012    
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
var i = 1;
var a = "0000000000000000"
.ToCharArray()
.GroupBy(x => i++%2).ToDictionary(x => x.Key, x => x.Select(u=>int.Parse(u.ToString())));
Console.WriteLine(a.Where(x => x.Key == 1)
.Zip(a.Where(x => x.Key == 0),
(x,y)=>new {l = x.Value
.Select(u => (u*2).ToString().ToCharArray().Select(z => int.Parse(z.ToString())).Sum()),
r = y.Value
.Select(u => u)})
.Sum(x => x.l.Sum() + x.r.Sum())%10 == 0);