static void GetPeriod(ValuesA a, ValuesC c, ValuesM m, ValuesX0 x0) { var generator = new RandomSequenceGenerator ( EnumValuesParser.GetValueA(a), EnumValuesParser.GetValueC(c), EnumValuesParser.GetValueM(m), EnumValuesParser.GetValueX0(x0) ); //FileWriter.WritePartOfSequenceToFile(filePath, generator.GetNextSequencePart()); while (!generator.IsEnded) { generator.GetNextSequencePart(); } Console.WriteLine($"{count++}) Period: {generator.Period}"); Console.WriteLine(); }
public static long GetValueM(ValuesM val) { switch (val) { case ValuesM.Pow10: { return((long)Math.Pow(2, 10) - 1); } case ValuesM.Pow11: { return((long)Math.Pow(2, 11) - 1); } case ValuesM.Pow12: { return((long)Math.Pow(2, 12) - 1); } case ValuesM.Pow13: { return((long)Math.Pow(2, 13) - 1); } case ValuesM.Pow14: { return((long)Math.Pow(2, 14) - 1); } case ValuesM.Pow15: { return((long)Math.Pow(2, 15) - 1); } case ValuesM.Pow16: { return((long)Math.Pow(2, 16) - 1); } case ValuesM.Pow17: { return((long)Math.Pow(2, 17) - 1); } case ValuesM.Pow18: { return((long)Math.Pow(2, 18) - 1); } case ValuesM.Pow19: { return((long)Math.Pow(2, 19) - 1); } case ValuesM.Pow20: { return((long)Math.Pow(2, 20) - 1); } case ValuesM.Pow21: { return((long)Math.Pow(2, 21) - 1); } case ValuesM.Pow22: { return((long)Math.Pow(2, 22) - 1); } case ValuesM.Pow23: { return((long)Math.Pow(2, 23) - 1); } case ValuesM.Pow24: { return((long)Math.Pow(2, 24) - 1); } case ValuesM.Pow25: { return((long)Math.Pow(2, 25) - 1); } case ValuesM.Pow26: { return((long)Math.Pow(2, 26) - 1); } case ValuesM.Pow27: { return((long)Math.Pow(2, 27) - 1); } case ValuesM.Pow28: { return((long)Math.Pow(2, 28) - 1); } case ValuesM.Pow29: { return((long)Math.Pow(2, 29) - 1); } case ValuesM.Pow30: { return((long)Math.Pow(2, 30) - 1); } case ValuesM.Pow31: { return((long)Math.Pow(2, 31)); } case ValuesM.Pow31Minus1: { return((long)Math.Pow(2, 31) - 1); } case ValuesM.Pow31Minus3: { return((long)Math.Pow(2, 31) - 3); } case ValuesM.Pow31Minus7: { return((long)Math.Pow(2, 31) - 7); } default: throw new Exception("Unknown value"); } }