diff --git a/JS/09.Special_Pythagorean_Triplet/guptaji048.js b/JS/09.Special_Pythagorean_Triplet/guptaji048.js new file mode 100644 index 0000000..4fcf147 --- /dev/null +++ b/JS/09.Special_Pythagorean_Triplet/guptaji048.js @@ -0,0 +1,14 @@ +/* +Euler 09 done in JavaScript +*/ +var c; + +for (var a = 1; a < 500; a++) { + for (var b = a; b < 1000; b++) { + c = Math.sqrt(a * a + b * b); + if (c % 1 === 0 && a + b + c == 1000) { + console.log("The triplets are", a, b, c); + console.log("Product is", a * b * c); + } + } +} diff --git a/README.md b/README.md index b794d72..bad88cb 100644 --- a/README.md +++ b/README.md @@ -5,90 +5,89 @@ Project Euler is a series of challenging problems that require mathematical and programming skills. Somebody who enjoys learning new area of mathematics, project Euler is going to be a fun journey. ## How to contribute? + - Fork this repository. - Make a directory with the format `problem_number.problem_statement` in the directory of the language you're solving. + ``` For example if you are solving Problem no 1 in java- > Your solution should be at -> Java/01.Multiples_of_3_and_5/your_user_name.java ``` + - Add :white_check_mark: `:white_check_mark:` to the table against the problem you've solved. - Name the P.R. With the format as `problem_number done in This_Lang`, and Mention the same in the code(File) as a comment `Euler Problem_num`.(**Within the File**) - While Editing The ReadMe For PR, Use "**No Wrap**" Option { At Top Right Of 'Edit File' Tool On Githtub} - Send a PR - [Thanks](#Thanks) - Happy Contributing! 😃 - ⭐ to show support! -## Contributors +## Contributors + [![](https://sourcerer.io/fame/imabhishekkumar/RisingLight/Project-Euler/images/0)](https://sourcerer.io/fame/imabhishekkumar/RisingLight/Project-Euler/links/0)[![](https://sourcerer.io/fame/imabhishekkumar/RisingLight/Project-Euler/images/1)](https://sourcerer.io/fame/imabhishekkumar/RisingLight/Project-Euler/links/1)[![](https://sourcerer.io/fame/imabhishekkumar/RisingLight/Project-Euler/images/2)](https://sourcerer.io/fame/imabhishekkumar/RisingLight/Project-Euler/links/2)[![](https://sourcerer.io/fame/imabhishekkumar/RisingLight/Project-Euler/images/3)](https://sourcerer.io/fame/imabhishekkumar/RisingLight/Project-Euler/links/3)[![](https://sourcerer.io/fame/imabhishekkumar/RisingLight/Project-Euler/images/4)](https://sourcerer.io/fame/imabhishekkumar/RisingLight/Project-Euler/links/4)[![](https://sourcerer.io/fame/imabhishekkumar/RisingLight/Project-Euler/images/5)](https://sourcerer.io/fame/imabhishekkumar/RisingLight/Project-Euler/links/5)[![](https://sourcerer.io/fame/imabhishekkumar/RisingLight/Project-Euler/images/6)](https://sourcerer.io/fame/imabhishekkumar/RisingLight/Project-Euler/links/6)[![](https://sourcerer.io/fame/imabhishekkumar/RisingLight/Project-Euler/images/7)](https://sourcerer.io/fame/imabhishekkumar/RisingLight/Project-Euler/links/7) ## Problems -| No | Problem Statement | CPP | Java | JS | Py3 | Kotlin | Dart | C | C# | Go Lang | R | Ruby | Swift | -|----|------------------------------------------------------------------------------|--------------------|--------------------|--------------------|--------------------|--------------------|--------------------|--------------------|--------------------|--------------------|--------------------|--------------------|--------------------| -| 01 | [Multiples of 3 and 5](https://projecteuler.net/problem=1) | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | -| 02 | [Even Fibonacci numbers](https://projecteuler.net/problem=2) | :white_check_mark: | :white_check_mark: | | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | | :white_check_mark: | :white_check_mark: | :white_check_mark: | | -| 03 | [Largest prime factor](https://projecteuler.net/problem=3) | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | | :white_check_mark: | :white_check_mark: | | :white_check_mark: | :white_check_mark: | | | -| 04 | [Largest palindrome product](https://projecteuler.net/problem=4) | :white_check_mark: | :white_check_mark: | | :white_check_mark: | | | :white_check_mark: | | :white_check_mark: | | | | -| 05 | [Smallest multiple](https://projecteuler.net/problem=5) | :white_check_mark: | | | :white_check_mark: | | | | | :white_check_mark: | | | | -| 06 | [Sum square difference](https://projecteuler.net/problem=6) | :white_check_mark: | :white_check_mark: | | :white_check_mark: | | :white_check_mark: | :white_check_mark: | | :white_check_mark: | | | | -| 07 | [10001st prime](https://projecteuler.net/problem=7) | :white_check_mark: | | | :white_check_mark: | | :white_check_mark: | :white_check_mark: | | | | | | -| 08 | [Largest product in a series](https://projecteuler.net/problem=8) | | | | :white_check_mark: | | | | | | | | | -| 09 | [Special Pythagorean triplet](https://projecteuler.net/problem=9) | :white_check_mark: | | | :white_check_mark: | | | | | | | | | -| 10 | [Summation of primes](https://projecteuler.net/problem=10) | | | | :white_check_mark: | | | :white_check_mark: | | | | | | -| 11 | [Largest product in a grid](https://projecteuler.net/problem=11) | | | | :white_check_mark: | | | :white_check_mark: | | | | | | -| 12 | [Highly divisible triangular number](https://projecteuler.net/problem=12) | | | | :white_check_mark: | | | :white_check_mark: | | | | | | -| 13 | [Large sum](https://projecteuler.net/problem=13) | :white_check_mark: | | | :white_check_mark: | | | | | | | | | -| 14 | [Longest Collatz sequence](https://projecteuler.net/problem=14) | | | | | | | | | | | | | -| 15 | [Lattice paths](https://projecteuler.net/problem=15) | | | | | | | | | | | | | -| 16 | [Power digit sum](https://projecteuler.net/problem=16) | | :white_check_mark: | | :white_check_mark: | | | | | | | | | -| 17 | [Number letter counts](https://projecteuler.net/problem=17) | | | | :white_check_mark: | | | | | | | | | -| 18 | [Maximum path sum I](https://projecteuler.net/problem=18) | | | | :white_check_mark: | | | | | | | | | -| 19 | [Counting Sundays](https://projecteuler.net/problem=19) | | | | | | | | | | | | | -| 20 | [Factorial digit sum](https://projecteuler.net/problem=20) | | :white_check_mark: | | :white_check_mark: | :white_check_mark: | | | | | | | | -| 21 | [Amicable numbers](https://projecteuler.net/problem=21) | | | | | | | | | | | | | -| 22 | [Names scores](https://projecteuler.net/problem=22) | | | | :white_check_mark: | | | | | | | | | -| 23 | [Non-abundant sums](https://projecteuler.net/problem=23) | | | | | | | | | | | | | -| 24 | [Lexicographic permutations](https://projecteuler.net/problem=24) | | | | | | | | | | | | | -| 25 | [1000-digit Fibonacci number](https://projecteuler.net/problem=25) | | | | :white_check_mark: | | | | | | | | | -| 26 | [Reciprocal cycles](https://projecteuler.net/problem=26) | | | | | | | | | | | | | -| 27 | [Quadratic primes](https://projecteuler.net/problem=27) | | :white_check_mark: | | | | | | | | | | | -| 28 | [Number spiral diagonals](https://projecteuler.net/problem=28) | :white_check_mark: | :white_check_mark: | | :white_check_mark: | | | :white_check_mark: | | | | | | -| 29 | [Distinct powers](https://projecteuler.net/problem=29) | | | | :white_check_mark: | | | | | | | | | -| 30 | [Digit fifth powers](https://projecteuler.net/problem=30) | | | | :white_check_mark: | | | | | | | | | -| 31 | [Coin sums](https://projecteuler.net/problem=31) | | :white_check_mark: | | :white_check_mark: | | | | | | | | | -| 32 | [Pandigital products](https://projecteuler.net/problem=32) | | | | | | | | | | | | | -| 33 | [Digit cancelling fractions](https://projecteuler.net/problem=33) | | | | | | | | | | | | | -| 34 | [Digit factorials](https://projecteuler.net/problem=34) | | | | | | | | | | | | | -| 35 | [Circular primes](https://projecteuler.net/problem=35) | | | | :white_check_mark: | | | | | | | | | -| 36 | [Double-base palindromes](https://projecteuler.net/problem=36) | | | | | | | | | | | | | -| 37 | [Truncatable primes](https://projecteuler.net/problem=37) | | | | | | | | | | | | | -| 38 | [Pandigital multiples](https://projecteuler.net/problem=38) | | | | | | | | | | | | | -| 39 | [Integer right triangles](https://projecteuler.net/problem=39) | :white_check_mark: | :white_check_mark: | | | | | | | | | | | -| 40 | [Champernowne's constant](https://projecteuler.net/problem=40) | | | | :white_check_mark: | | | | | | | | | -| 41 | [Pandigital prime](https://projecteuler.net/problem=41) | | | | :white_check_mark: | | | | | | | | | -| 42 | [Coded triangle numbers](https://projecteuler.net/problem=42) | | | | :white_check_mark: | | | | | | | | | -| 43 | [Sub-string divisibility](https://projecteuler.net/problem=43) | | | | | | | | | | | | | -| 44 | [Pentagon numbers](https://projecteuler.net/problem=44) | | | | :white_check_mark: | | | | | | | | | -| 45 | [Triangular, pentagonal, and hexagonal](https://projecteuler.net/problem=45) | | | | :white_check_mark: | | | | | | | | | -| 46 | [Goldbach's other conjecture](https://projecteuler.net/problem=46) | | | | :white_check_mark: | | | | | | | | | -| 47 | [Distinct primes factors](https://projecteuler.net/problem=47) | | | | :white_check_mark: | | | | | | | | | -| 48 | [Self powers](https://projecteuler.net/problem=48) | | | | :white_check_mark: | | | | | | | | | -| 49 | [Prime permutations](https://projecteuler.net/problem=49) | | | | :white_check_mark: | | | | | | | | | -| 50 | [Consecutive prime sum](https://projecteuler.net/problem=50) | | | | :white_check_mark: | | | :white_check_mark: | | :white_check_mark: | | | | - +| No | Problem Statement | CPP | Java | JS | Py3 | Kotlin | Dart | C | C# | Go Lang | R | Ruby | Swift | +| --- | ---------------------------------------------------------------------------- | ------------------ | ------------------ | ------------------ | ------------------ | ------------------ | ------------------ | ------------------ | ------------------ | ------------------ | ------------------ | ------------------ | ------------------ | +| 01 | [Multiples of 3 and 5](https://projecteuler.net/problem=1) | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | +| 02 | [Even Fibonacci numbers](https://projecteuler.net/problem=2) | :white_check_mark: | :white_check_mark: | | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | | :white_check_mark: | :white_check_mark: | :white_check_mark: | | +| 03 | [Largest prime factor](https://projecteuler.net/problem=3) | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | | :white_check_mark: | :white_check_mark: | | :white_check_mark: | :white_check_mark: | | | +| 04 | [Largest palindrome product](https://projecteuler.net/problem=4) | :white_check_mark: | :white_check_mark: | | :white_check_mark: | | | :white_check_mark: | | :white_check_mark: | | | | +| 05 | [Smallest multiple](https://projecteuler.net/problem=5) | :white_check_mark: | | | :white_check_mark: | | | | | :white_check_mark: | | | | +| 06 | [Sum square difference](https://projecteuler.net/problem=6) | :white_check_mark: | :white_check_mark: | | :white_check_mark: | | :white_check_mark: | :white_check_mark: | | :white_check_mark: | | | | +| 07 | [10001st prime](https://projecteuler.net/problem=7) | :white_check_mark: | | | :white_check_mark: | | :white_check_mark: | :white_check_mark: | | | | | | +| 08 | [Largest product in a series](https://projecteuler.net/problem=8) | | | | :white_check_mark: | | | | | | | | | +| 09 | [Special Pythagorean triplet](https://projecteuler.net/problem=9) | :white_check_mark: | | :white_check_mark: | :white_check_mark: | | | | | | | | | +| 10 | [Summation of primes](https://projecteuler.net/problem=10) | | | | :white_check_mark: | | | :white_check_mark: | | | | | | +| 11 | [Largest product in a grid](https://projecteuler.net/problem=11) | | | | :white_check_mark: | | | :white_check_mark: | | | | | | +| 12 | [Highly divisible triangular number](https://projecteuler.net/problem=12) | | | | :white_check_mark: | | | :white_check_mark: | | | | | | +| 13 | [Large sum](https://projecteuler.net/problem=13) | :white_check_mark: | | | :white_check_mark: | | | | | | | | | +| 14 | [Longest Collatz sequence](https://projecteuler.net/problem=14) | | | | | | | | | | | | | +| 15 | [Lattice paths](https://projecteuler.net/problem=15) | | | | | | | | | | | | | +| 16 | [Power digit sum](https://projecteuler.net/problem=16) | | :white_check_mark: | | :white_check_mark: | | | | | | | | | +| 17 | [Number letter counts](https://projecteuler.net/problem=17) | | | | :white_check_mark: | | | | | | | | | +| 18 | [Maximum path sum I](https://projecteuler.net/problem=18) | | | | :white_check_mark: | | | | | | | | | +| 19 | [Counting Sundays](https://projecteuler.net/problem=19) | | | | | | | | | | | | | +| 20 | [Factorial digit sum](https://projecteuler.net/problem=20) | | :white_check_mark: | | :white_check_mark: | :white_check_mark: | | | | | | | | +| 21 | [Amicable numbers](https://projecteuler.net/problem=21) | | | | | | | | | | | | | +| 22 | [Names scores](https://projecteuler.net/problem=22) | | | | :white_check_mark: | | | | | | | | | +| 23 | [Non-abundant sums](https://projecteuler.net/problem=23) | | | | | | | | | | | | | +| 24 | [Lexicographic permutations](https://projecteuler.net/problem=24) | | | | | | | | | | | | | +| 25 | [1000-digit Fibonacci number](https://projecteuler.net/problem=25) | | | | :white_check_mark: | | | | | | | | | +| 26 | [Reciprocal cycles](https://projecteuler.net/problem=26) | | | | | | | | | | | | | +| 27 | [Quadratic primes](https://projecteuler.net/problem=27) | | :white_check_mark: | | | | | | | | | | | +| 28 | [Number spiral diagonals](https://projecteuler.net/problem=28) | :white_check_mark: | :white_check_mark: | | :white_check_mark: | | | :white_check_mark: | | | | | | +| 29 | [Distinct powers](https://projecteuler.net/problem=29) | | | | :white_check_mark: | | | | | | | | | +| 30 | [Digit fifth powers](https://projecteuler.net/problem=30) | | | | :white_check_mark: | | | | | | | | | +| 31 | [Coin sums](https://projecteuler.net/problem=31) | | :white_check_mark: | | :white_check_mark: | | | | | | | | | +| 32 | [Pandigital products](https://projecteuler.net/problem=32) | | | | | | | | | | | | | +| 33 | [Digit cancelling fractions](https://projecteuler.net/problem=33) | | | | | | | | | | | | | +| 34 | [Digit factorials](https://projecteuler.net/problem=34) | | | | | | | | | | | | | +| 35 | [Circular primes](https://projecteuler.net/problem=35) | | | | :white_check_mark: | | | | | | | | | +| 36 | [Double-base palindromes](https://projecteuler.net/problem=36) | | | | | | | | | | | | | +| 37 | [Truncatable primes](https://projecteuler.net/problem=37) | | | | | | | | | | | | | +| 38 | [Pandigital multiples](https://projecteuler.net/problem=38) | | | | | | | | | | | | | +| 39 | [Integer right triangles](https://projecteuler.net/problem=39) | :white_check_mark: | :white_check_mark: | | | | | | | | | | | +| 40 | [Champernowne's constant](https://projecteuler.net/problem=40) | | | | :white_check_mark: | | | | | | | | | +| 41 | [Pandigital prime](https://projecteuler.net/problem=41) | | | | :white_check_mark: | | | | | | | | | +| 42 | [Coded triangle numbers](https://projecteuler.net/problem=42) | | | | :white_check_mark: | | | | | | | | | +| 43 | [Sub-string divisibility](https://projecteuler.net/problem=43) | | | | | | | | | | | | | +| 44 | [Pentagon numbers](https://projecteuler.net/problem=44) | | | | :white_check_mark: | | | | | | | | | +| 45 | [Triangular, pentagonal, and hexagonal](https://projecteuler.net/problem=45) | | | | :white_check_mark: | | | | | | | | | +| 46 | [Goldbach's other conjecture](https://projecteuler.net/problem=46) | | | | :white_check_mark: | | | | | | | | | +| 47 | [Distinct primes factors](https://projecteuler.net/problem=47) | | | | :white_check_mark: | | | | | | | | | +| 48 | [Self powers](https://projecteuler.net/problem=48) | | | | :white_check_mark: | | | | | | | | | +| 49 | [Prime permutations](https://projecteuler.net/problem=49) | | | | :white_check_mark: | | | | | | | | | +| 50 | [Consecutive prime sum](https://projecteuler.net/problem=50) | | | | :white_check_mark: | | | :white_check_mark: | | :white_check_mark: | | | | ## Thanks - Thanks to you all who are doing their best in solving the problems, we appriciate your efforts. - We thank you all for the overwelming P.R that we have recieved, To mantain the quality and response of the P.R we have updated the -[guidelines](#How-to-contribute). + [guidelines](#How-to-contribute). - We are reluctant to change/modify the already merged P.R. to meet the current Guidelines, as that may modify the contributer's title to that file. - We would appriciate, if all of you could do the necessary modification, hence it won't affect your contribution as per HacktoberFest. - Keep Up the Efforts. - -