This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function doubleInteger(i) { | |
// i will be an integer. Double it and return it. | |
return i *= 2; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// A palindromic number reads the same both ways. | |
// The largest palindrome made from the product of two 2-digit numbers is 9009 = 91 × 99. | |
// Find the largest palindrome made from the product of two 3-digit numbers. | |
var largest = 0; | |
console.log(largestPalindromeByThreeDigits(100, 100)); | |
function largestPalindromeByThreeDigits (j, i) { | |
for (var j = 100; j < 1000; j++){ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 2520 is the smallest number that can be divided by each of the numbers from 1 to 10 without any remainder. | |
// What is the smallest positive number that is evenly divisible by all of the numbers from 1 to 20? | |
var smallestNumber = 19; | |
var uDone = false; | |
while (!uDone) { | |
smallestNumber++; | |
for (var i = 1; i <= 20; i++){ | |
if(!isDivisible(i, smallestNumber)){ |