static void Main(string[] args) { var solver = new ProblemSolver(); Console.WriteLine(solver.FindSmallestPrimeWithFamilyLength(8)); }
public int GetReplacedNumber_Test_Replace_2_Digit(int original, int digit1, int digit2, int newDigit) { var solver = new ProblemSolver(); return solver.GetReplacedNumber(original, new int[] { digit1, digit2 }, newDigit); }
public void GetSmallestPrimeWithFamily7() { var solver = new ProblemSolver(); var result = solver.FindSmallestPrimeWithFamilyLength(7); Assert.That(result, Is.EqualTo(56003)); }
public void GetPrimeFamilyLength13() { var solver = new ProblemSolver(); var result = solver.GetPrimeFamilyLength(13, new int[] { 1 }); Assert.That(result, Is.EqualTo(4)); result = solver.GetPrimeFamilyLength(13, new int[] { 0 }); Assert.That(result, Is.EqualTo(6)); }
public void GetPrimeFamilyLength() { var solver = new ProblemSolver(); var result = solver.GetPrimeFamilyLength(56003, new int[] {2, 3}); Assert.That(result, Is.EqualTo(7)); }
public void GetAllDigits() { var solver = new ProblemSolver(); var result = solver.GetAllDigitPermutations(1313); Assert.That(result.Count(), Is.EqualTo(15)); var e0 = result.ElementAt(0); Assert.That(e0.ToArray(), Is.EqualTo(new int[] { 3 })); var e1 = result.ElementAt(1); Assert.That(e1.ToArray(), Is.EqualTo(new int[] { 2 })); var e2 = result.ElementAt(2); Assert.That(e2.ToArray(), Is.EqualTo(new int[] { 2, 3 })); var e3 = result.ElementAt(3); Assert.That(e3.ToArray(), Is.EqualTo(new int[] { 1 })); var e4 = result.ElementAt(4); Assert.That(e4.ToArray(), Is.EqualTo(new int[] { 1, 3 })); var e5 = result.ElementAt(5); Assert.That(e5.ToArray(), Is.EqualTo(new int[] { 1, 2 })); var e6 = result.ElementAt(6); Assert.That(e6.ToArray(), Is.EqualTo(new int[] { 1, 2, 3 })); }
public void Get1sInNumber3() { var solver = new ProblemSolver(); var result = solver.Get1sInNumber(8, 74); Assert.That(result.ToArray(), Is.EqualTo(new int[] { 1, 4, 6 })); }
public void Get1sInNumber2() { var solver = new ProblemSolver(); var result = solver.Get1sInNumber(5, 13); Assert.That(result.ToArray(), Is.EqualTo(new int[] { 1, 2, 4 })); }