From 2e877bbd7dc1981d23f4ff9fb8329c4c102f7977 Mon Sep 17 00:00:00 2001 From: juanrossano Date: Wed, 7 Sep 2022 01:16:57 -0300 Subject: [PATCH 1/3] Update factorial.js --- src/factorial.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/factorial.js b/src/factorial.js index 4f3ae70..e64cb61 100644 --- a/src/factorial.js +++ b/src/factorial.js @@ -1,5 +1,9 @@ const factorial = (number) => { - // your code here + var valor = 1; + for( var i=number;i>0;i--) { + valor *= i; + } + return valor; } -module.exports = factorial; \ No newline at end of file +module.exports = factorial; From 2a3ddacb877a7849b684aeaff3fbf5ef211df66d Mon Sep 17 00:00:00 2001 From: juanrossano Date: Wed, 7 Sep 2022 01:17:33 -0300 Subject: [PATCH 2/3] Update fibonacci.js --- src/fibonacci.js | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/src/fibonacci.js b/src/fibonacci.js index ea3270f..b759d91 100644 --- a/src/fibonacci.js +++ b/src/fibonacci.js @@ -1,5 +1,17 @@ const fibonacci = (n) => { - // your code here + var lista = new Array; + var anterior = 0; + var siguiente = 1; + var numero = 0; + lista.push(1) +// for( ;lista.length Date: Wed, 7 Sep 2022 01:18:11 -0300 Subject: [PATCH 3/3] Update primalidad.js --- src/primalidad.js | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/src/primalidad.js b/src/primalidad.js index 8bdb849..1a2ec4c 100644 --- a/src/primalidad.js +++ b/src/primalidad.js @@ -1,5 +1,22 @@ const trialDivision = (number) => { - // your code here + var valor = true; + if (number == 1 || !Number.isInteger(number) ) + valor = false; + else { + var valor = (number>1); + for( var i=2;i