https://github.com/bugdaryan/fibonaccisequence
Program that gets sequence of Fibonacci from specified start and specified count
https://github.com/bugdaryan/fibonaccisequence
dotnet-core fibonacci-sequence
Last synced: 4 months ago
JSON representation
Program that gets sequence of Fibonacci from specified start and specified count
- Host: GitHub
- URL: https://github.com/bugdaryan/fibonaccisequence
- Owner: bugdaryan
- Created: 2019-03-30T16:03:35.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2019-03-30T17:45:41.000Z (about 6 years ago)
- Last Synced: 2025-01-10T17:48:49.236Z (6 months ago)
- Topics: dotnet-core, fibonacci-sequence
- Language: C#
- Size: 7.81 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Fibonacci Sequence
Program that gets sequence of Fibonacci from specified start and specified count#### Usage
##### Run from terminal/bash
1. Go to project directory
2. Open terminal/bash in that directory
3. type
* dotnet run < start index > < count > (this will print first numbers of Fibonacci sequence started from )
* dotnet run < count > (this will print first numbers of Fibonacci sequence)
* dotnet run (this will print first 100 elements of Fibonacci sequence)##### Run from code
Function signature is
~~~csharp
public static IEnumerable FibonacciSequence();
~~~#### Examples
~~~csharp
var fibs = FibonacciSequence();
foreach(var num in fibs.Skip(10).Take(20))
{
Console.WriteLine(num);
}
~~~
~~~csharp
var fibs = FibonacciSequence();
BigInteger sum = fibs.Take(n).Aggregate((sum,num) => sum+=num);
~~~