I resumed my code katas – this time, I’m using Erlang to solve the problem:
By listing the first six prime numbers: 2, 3, 5, 7, 11, and 13, we can see that the 6th prime is 13.
What is the 10001st prime number?
NOTE: This is an archive of my old blog. Go to http://gonium.net for my current website.
I resumed my code katas – this time, I’m using Erlang to solve the problem:
By listing the first six prime numbers: 2, 3, 5, 7, 11, and 13, we can see that the 6th prime is 13.
What is the 10001st prime number?
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.I designed a routine that checks whether a given number is a palindrome. This routine is then used inside two loops iterating from 999 downto 0. The first hit is the largest palindrome. The core functionality is here: bool Problem4::isPalindrome(long number) { bool retval = false; std::vector
The prime factors of 13195 are 5, 7, 13 and 29. What is the largest prime factor of the number 600851475143 ?Pretty straightforward: Just test and recurse. Continue reading...