It's Fibonacci series I guess:
Try this,
using System;
using System.Collections.Generic;
using System.Text;
namespace fibseries
{
class Program
{
static void Main(string[] args)
{
int num;
Console.WriteLine("Please Enter a number:");
num = Convert.ToInt32(Console.ReadLine());
Console.WriteLine("\n");
Console.WriteLine("The first " + num + " number(s) in the fibonacci series are: ");
FibonacciSeries(num);
Console.Read();
}
public static int FibonacciSeries(int n)
{
int previous = -1;
int next = 1;
for (int i = 0; i < n; i++)
{
int sum = next + previous;
previous = next;
next = sum;
Console.WriteLine(next);
}
return next;
}
}
More examples:
How to generate Fibonacci series in c#[
^]
C# Fibonacci Sequence[
^]
Detailed description with some images:
Fibonacci Series Program using Recursion in C#[
^]