using System;
using System.Collections.Generic;
using System.Linq;
public class Program
{
public static void Main()
IEnumerable<int> ids = new List<int>() { 1, 2, 3};
var query = ids.GroupBy(x => x)
.Where(g => g.Count() > 1)
.SelectMany(z => z);
Console.WriteLine(query);
}