Código:
function fibonacci(value){
if(value==0){
return 0;
}
if(value==1){
return 1;
}
return fib(value-1) + fib(value-2);
}
Cuando se tenga la necesidad de un cálculo de ésta naturaleza, se puede hacer con ésta sencilla fórmula.
Sin embargo, para efectos de rendimiento se recomienda tomar un arreglo y leer directamente los resultados iniciando en 0.
var arrayFibonacci = [0,
1,
1,
2,
3,
5,
8,
13,
21,
34,
55,
89,
144,
233,
377,
610,
987,
1597,
2584,
4181,
6765,
10946,
17711,
28657,
46368,
75025,
121393,
196418,
317811,
514229,
832040,
1346269,
2178309,
3524578,
5702887,
9227465,
14930352,
24157817,
39088169,
63245986,
102334155,
165580141,
267914296,
433494437,
701408733,
1134903170,
1836311903,
2971215073,
4807526976,
7778742049,
12586269025,
20365011074,
32951280099,
53316291173,
86267571272,
139583862445,
225851433717,
365435296162,
591286729879,
956722026041,
1548008755920,
2504730781961,
4052739537881,
6557470319842,
10610209857723,
17167680177565,
27777890035288,
44945570212853,
72723460248141,
117669030460994,
190392490709135,
308061521170129,
498454011879264,
806515533049393,
1304969544928660,
2111485077978050,
3416454622906710,
5527939700884760,
8944394323791460,
14472334024676200,
23416728348467700,
37889062373143900,
61305790721611600,
99194853094755500,
160500643816367000,
259695496911123000,
420196140727490000,
679891637638612000,
1100087778366100000,
1779979416004710000,
2880067194370820000,
4660046610375530000,
7540113804746350000,
12200160415121900000,
19740274219868200000,
31940434634990100000,
51680708854858300000,
83621143489848400000,
135301852344707000000,
218922995834555000000,
354224848179262000000,
573147844013817000000,
927372692193079000000,
1500520536206900000000,
2427893228399980000000,
3928413764606870000000,
6356306993006850000000,
10284720757613700000000,
16641027750620600000000,
26925748508234300000000,
43566776258854900000000,
70492524767089100000000,
114059301025944000000000];
Suscribirse a:
Entradas (Atom)
Páginas
Etiquetas
INTERNET
(459)
newsweek
(305)
SEGURIDAD
(224)
software
(136)
HACK
(86)
GOOGLE
(47)
Hacker
(46)
Geek
(41)
hardware
(36)
WINDOWS
(34)
Hackers
(31)
CRACK
(29)
facebook
(29)
video
(28)
DESCARGA
(27)
videos
(26)
Celulares
(25)
MICROSOFT
(22)
Informatica
(21)
apple
(19)
GRATIS
(18)
technology
(18)
virus
(18)
exploit
(17)
computación
(16)
informatico
(16)
web
(15)
cracker
(14)
INALAMBRICO
(13)
WINDOWS 7
(13)
noticias
(11)
MSN
(10)
termino
(10)
ACTUALIZACION
(9)
Gamer
(9)
LapTops
(9)
Mac
(9)
PASSWORD
(9)
WINDOWS XP
(9)
dns
(9)
firefox
(9)
juegos
(9)
FOTOS
(8)
cientifico
(8)
iphone
(8)
WEP
(7)
antivirus
(7)
bibliografia
(7)
Desencriptar
(6)
INFINITUM
(6)
wifi
(6)
youtube
(6)
Craker
(5)
Culiacan
(5)
DESMOSTRACION
(5)
TELEFONIA
(5)
gmail
(5)
messenger
(5)
DIRECTA
(4)
DOWNLOAD
(4)
ESPAÑOL
(4)
XBOX
(4)
xss
(4)
Glosario
(3)
HTML
(3)
WPA
(3)
anuncios
(3)
ataques
(3)
hosting
(3)
hotmail
(3)
Guru
(2)
ajax
(2)
wpa2
(2)