I work to implement an RSA key algorithm. But I couldn't use a 2048-bit value. How I can use it?
I want to use big integer.
Here's using BigInteger
. This method Prints Numbers in the Fibonacci Sequence up to n
.
public static void FibonacciSequence(int n)
{
/** BigInteger easily holds the first 1000 numbers in the Fibonacci Sequence. **/
List<BigInteger> fibonacci = new List<BigInteger>();
fibonacci.Add(0);
fibonacci.Add(1);
BigInteger i = 2;
while(i < n)
{
int first = (int)i - 2;
int second = (int) i - 1;
BigInteger firstNumber = fibonacci[first];
BigInteger secondNumber = fibonacci[second];
BigInteger sum = firstNumber + secondNumber;
fibonacci.Add(sum);
i++;
}
foreach (BigInteger f in fibonacci) { Console.WriteLine(f); }
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With