using System.Collections.Generic;
static void Main(string[] args)
List<int> factors3 = new List<int>();
List<int> factors5 = new List<int>();
for (var i = 1; i <= n; i++)
Console.WriteLine(FindNum(factors3, factors5, n));
private static string FindNum(List<int> factors3, List<int> factors5, int n)
foreach (var f3 in factors3)
int f5 = factors5.Where(f => f + f3 == n).SingleOrDefault();
return String.Format("5: " + f5 + " | " + "3:" + f3 + " ");
if (factors3.Exists(f => f == n))
factors5.ForEach(f => Console.WriteLine(f));