Files
even-perfect-numbers-scanner/PerfectNumbers.Core/BigIntegerNumbers.cs

143 lines
9.5 KiB
C#

using System.Numerics;
namespace PerfectNumbers.Core
{
public static class BigIntegerNumbers
{
public static readonly BigInteger OneShiftedLeft63 = BigInteger.One << 63;
public static readonly BigInteger OneShiftedLeft256MinusOne = (BigInteger.One << 256) - BigInteger.One;
public static readonly BigInteger UlongMaxValue = (BigInteger)ulong.MaxValue;
public static readonly BigInteger UlongMaxValuePlusOne = UlongMaxValue + BigInteger.One;
public static readonly BigInteger UInt128MaxValue = (BigInteger)UInt128.MaxValue;
public static readonly BigInteger UInt128MaxValuePlusOne = UInt128MaxValue + BigInteger.One;
public static readonly BigInteger Two = 2UL;
public static readonly BigInteger Pow2Exact2 = 4UL;
public static readonly BigInteger Pow2Exact3 = 8UL;
public static readonly BigInteger Pow2Exact4 = 16UL;
public static readonly BigInteger Pow2Exact5 = 32UL;
public static readonly BigInteger Pow2Exact6 = 64UL;
public static readonly BigInteger Pow2Exact7 = 128UL;
public static readonly BigInteger Pow2Exact8 = 256UL;
public static readonly BigInteger Pow2Exact9 = 512UL;
public static readonly BigInteger Pow2Exact10 = 1_024UL;
public static readonly BigInteger Pow2Exact11 = 2_048UL;
public static readonly BigInteger Pow2Exact12 = 4_096UL;
public static readonly BigInteger Pow2Exact13 = 8_192UL;
public static readonly BigInteger Pow2Exact14 = 16_384UL;
public static readonly BigInteger Pow2Exact15 = 32_768UL;
public static readonly BigInteger Pow2Exact16 = 65_536UL;
public static readonly BigInteger Pow2Exact17 = 131_072UL;
public static readonly BigInteger Pow2Exact18 = 262_144UL;
public static readonly BigInteger Pow2Exact19 = 524_288UL;
public static readonly BigInteger Pow2Exact20 = 1_048_576UL;
public static readonly BigInteger Pow2Exact21 = 2_097_152UL;
public static readonly BigInteger Pow2Exact22 = 4_194_304UL;
public static readonly BigInteger Pow2Exact23 = 8_388_608UL;
public static readonly BigInteger Pow2Exact24 = 16_777_216UL;
public static readonly BigInteger Pow2Exact25 = 33_554_432UL;
public static readonly BigInteger Pow2Exact26 = 67_108_864UL;
public static readonly BigInteger Pow2Exact27 = 134_217_728UL;
public static readonly BigInteger Pow2Exact28 = 268_435_456UL;
public static readonly BigInteger Pow2Exact29 = 536_870_912UL;
public static readonly BigInteger Pow2Exact30 = 1_073_741_824UL;
public static readonly BigInteger Pow2Exact31 = 2_147_483_648UL;
public static readonly BigInteger Pow2Exact32 = 4_294_967_296UL;
public static readonly BigInteger Pow2Exact33 = 8_589_934_592UL;
public static readonly BigInteger Pow2Exact34 = 17_179_869_184UL;
public static readonly BigInteger Pow2Exact35 = 34_359_738_368UL;
public static readonly BigInteger Pow2Exact36 = 68_719_476_736UL;
public static readonly BigInteger Pow2Exact37 = 137_438_953_472UL;
public static readonly BigInteger Pow2Exact38 = 274_877_906_944UL;
public static readonly BigInteger Pow2Exact39 = 549_755_813_888UL;
public static readonly BigInteger Pow2Exact40 = 1_099_511_627_776UL;
public static readonly BigInteger Pow2Exact41 = 2_199_023_255_552UL;
public static readonly BigInteger Pow2Exact42 = 4_398_046_511_104UL;
public static readonly BigInteger Pow2Exact43 = 8_796_093_022_208UL;
public static readonly BigInteger Pow2Exact44 = 17_592_186_044_416UL;
public static readonly BigInteger Pow2Exact45 = 35_184_372_088_832UL;
public static readonly BigInteger Pow2Exact46 = 70_368_744_177_664UL;
public static readonly BigInteger Pow2Exact47 = 140_737_488_355_328UL;
public static readonly BigInteger Pow2Exact48 = 281_474_976_710_656UL;
public static readonly BigInteger Pow2Exact49 = 562_949_953_421_312UL;
public static readonly BigInteger Pow2Exact50 = 1_125_899_906_842_624UL;
public static readonly BigInteger Pow2Exact51 = 2_251_799_813_685_248UL;
public static readonly BigInteger Pow2Exact52 = 4_503_599_627_370_496UL;
public static readonly BigInteger Pow2Exact53 = 9_007_199_254_740_992UL;
public static readonly BigInteger Pow2Exact54 = 18_014_398_509_481_984UL;
public static readonly BigInteger Pow2Exact55 = 36_028_797_018_963_968UL;
public static readonly BigInteger Pow2Exact56 = 72_057_594_037_927_936UL;
public static readonly BigInteger Pow2Exact57 = 144_115_188_075_855_872UL;
public static readonly BigInteger Pow2Exact58 = 288_230_376_151_711_744UL;
public static readonly BigInteger Pow2Exact59 = 576_460_752_303_423_488UL;
public static readonly BigInteger Pow2Exact60 = 1_152_921_504_606_846_976UL;
public static readonly BigInteger Pow2Exact61 = 2_305_843_009_213_693_952UL;
public static readonly BigInteger Pow2Exact62 = 4_611_686_018_427_387_904UL;
public static readonly BigInteger Pow2Exact63 = 9_223_372_036_854_775_808UL;
public static readonly BigInteger Pow2MinusOne1 = 2UL - 1UL;
public static readonly BigInteger Pow2MinusOne2 = 4UL - 1UL;
public static readonly BigInteger Pow2MinusOne3 = 8UL - 1UL;
public static readonly BigInteger Pow2MinusOne4 = 16UL - 1UL;
public static readonly BigInteger Pow2MinusOne5 = 32UL - 1UL;
public static readonly BigInteger Pow2MinusOne6 = 64UL - 1UL;
public static readonly BigInteger Pow2MinusOne7 = 128UL - 1UL;
public static readonly BigInteger Pow2MinusOne8 = 256UL - 1UL;
public static readonly BigInteger Pow2MinusOne9 = 512UL - 1UL;
public static readonly BigInteger Pow2MinusOne10 = 1_024UL - 1UL;
public static readonly BigInteger Pow2MinusOne11 = 2_048UL - 1UL;
public static readonly BigInteger Pow2MinusOne12 = 4_096UL - 1UL;
public static readonly BigInteger Pow2MinusOne13 = 8_192UL - 1UL;
public static readonly BigInteger Pow2MinusOne14 = 16_384UL - 1UL;
public static readonly BigInteger Pow2MinusOne15 = 32_768UL - 1UL;
public static readonly BigInteger Pow2MinusOne16 = 65_536UL - 1UL;
public static readonly BigInteger Pow2MinusOne17 = 131_072UL - 1UL;
public static readonly BigInteger Pow2MinusOne18 = 262_144UL - 1UL;
public static readonly BigInteger Pow2MinusOne19 = 524_288UL - 1UL;
public static readonly BigInteger Pow2MinusOne20 = 1_048_576UL - 1UL;
public static readonly BigInteger Pow2MinusOne21 = 2_097_152UL - 1UL;
public static readonly BigInteger Pow2MinusOne22 = 4_194_304UL - 1UL;
public static readonly BigInteger Pow2MinusOne23 = 8_388_608UL - 1UL;
public static readonly BigInteger Pow2MinusOne24 = 16_777_216UL - 1UL;
public static readonly BigInteger Pow2MinusOne25 = 33_554_432UL - 1UL;
public static readonly BigInteger Pow2MinusOne26 = 67_108_864UL - 1UL;
public static readonly BigInteger Pow2MinusOne27 = 134_217_728UL - 1UL;
public static readonly BigInteger Pow2MinusOne28 = 268_435_456UL - 1UL;
public static readonly BigInteger Pow2MinusOne29 = 536_870_912UL - 1UL;
public static readonly BigInteger Pow2MinusOne30 = 1_073_741_824UL - 1UL;
public static readonly BigInteger Pow2MinusOne31 = 2_147_483_648UL - 1UL;
public static readonly BigInteger Pow2MinusOne32 = 4_294_967_296UL - 1UL;
public static readonly BigInteger Pow2MinusOne33 = 8_589_934_592UL - 1UL;
public static readonly BigInteger Pow2MinusOne34 = 17_179_869_184UL - 1UL;
public static readonly BigInteger Pow2MinusOne35 = 34_359_738_368UL - 1UL;
public static readonly BigInteger Pow2MinusOne36 = 68_719_476_736UL - 1UL;
public static readonly BigInteger Pow2MinusOne37 = 137_438_953_472UL - 1UL;
public static readonly BigInteger Pow2MinusOne38 = 274_877_906_944UL - 1UL;
public static readonly BigInteger Pow2MinusOne39 = 549_755_813_888UL - 1UL;
public static readonly BigInteger Pow2MinusOne40 = 1_099_511_627_776UL - 1UL;
public static readonly BigInteger Pow2MinusOne41 = 2_199_023_255_552UL - 1UL;
public static readonly BigInteger Pow2MinusOne42 = 4_398_046_511_104UL - 1UL;
public static readonly BigInteger Pow2MinusOne43 = 8_796_093_022_208UL - 1UL;
public static readonly BigInteger Pow2MinusOne44 = 17_592_186_044_416UL - 1UL;
public static readonly BigInteger Pow2MinusOne45 = 35_184_372_088_832UL - 1UL;
public static readonly BigInteger Pow2MinusOne46 = 70_368_744_177_664UL - 1UL;
public static readonly BigInteger Pow2MinusOne47 = 140_737_488_355_328UL - 1UL;
public static readonly BigInteger Pow2MinusOne48 = 281_474_976_710_656UL - 1UL;
public static readonly BigInteger Pow2MinusOne49 = 562_949_953_421_312UL - 1UL;
public static readonly BigInteger Pow2MinusOne50 = 1_125_899_906_842_624UL - 1UL;
public static readonly BigInteger Pow2MinusOne51 = 2_251_799_813_685_248UL - 1UL;
public static readonly BigInteger Pow2MinusOne52 = 4_503_599_627_370_496UL - 1UL;
public static readonly BigInteger Pow2MinusOne53 = 9_007_199_254_740_992UL - 1UL;
public static readonly BigInteger Pow2MinusOne54 = 18_014_398_509_481_984UL - 1UL;
public static readonly BigInteger Pow2MinusOne55 = 36_028_797_018_963_968UL - 1UL;
public static readonly BigInteger Pow2MinusOne56 = 72_057_594_037_927_936UL - 1UL;
public static readonly BigInteger Pow2MinusOne57 = 144_115_188_075_855_872UL - 1UL;
public static readonly BigInteger Pow2MinusOne58 = 288_230_376_151_711_744UL - 1UL;
public static readonly BigInteger Pow2MinusOne59 = 576_460_752_303_423_488UL - 1UL;
public static readonly BigInteger Pow2MinusOne60 = 1_152_921_504_606_846_976UL - 1UL;
public static readonly BigInteger Pow2MinusOne61 = 2_305_843_009_213_693_952UL - 1UL;
public static readonly BigInteger Pow2MinusOne62 = 4_611_686_018_427_387_904UL - 1UL;
public static readonly BigInteger Pow2MinusOne63 = 9_223_372_036_854_775_808UL - 1UL;
public static readonly BigInteger Pow2MinusOne1024 = (BigInteger.One << 1024) - BigInteger.One;
}
}