// Renvoie le énième terme de la suite de Fibonacci
private static long Fibonnaci(int term)
{
long n1 = 1;
long n2 = 1;
if (term > 0)
{
if (term <= 2) return 1;
else
{
for (int i = 3; i < term; i++)
{
if ((i & 1) == 0) n1 += n2;
else n2 += n1;
}
return n1 + n2;
}
}
return -1;
}