Albert and Bernard became friends with Cheryl, and they want to know when her birthday is. Cheryl gives them a list of 10 possible dates.
|May 15||May 16||May 19|
|June 17||June 18|
|July 14||July 16|
|August 14||August 15||August 17|
Cheryl then tells Albert and Bernard separately the month and day of her birthday respectively.
Albert: I don't know when Cheryl's birthday is, but I know that Bernard does not know too.
Bernard: At first I don't know when Cheryl's birthday is, but I know now.
Albert: Then I also know when Cheryl's birthday is.
So when is Cheryl's birthday?
Write a program that prints the numbers from 1 to 100. But for multiples of three print "fizz" instead of the number and for the multiples of five print "buzz". For numbers which are multiples of both three and five print "fizzbuzz." Apparently this question is used to weed out 99.5% of candidates. Be sure to know this one!
It was proposed by Christian Goldbach that every odd composite number can be written as the sum of a prime and twice a square. For example,
It turns out the conjecture was false. What is the smallest odd composite that cannot be written as the sum of a prime and twice a square?
The sequence of triangle numbers is generated by adding the natural numbers. So the 7th triangle number would be 1 + 2 + 3 + 4 + 5 + 6 + 7 = 28. The first ten terms would be:
Let us list the factors of the first seven triangle numbers:
We can see that 28 is the first triangle number to have over five divisors.
What is the value of the first triangle number to have over five hundred divisors?
Define a method that checks if a given singly Linked List is a palindrome.
Find the longest palindrome substring that exists within a string.
Euler discovered the remarkable quadratic formula:
It turns out that the formula will produce 40 primes for the consecutive values n = 0 to 39. However, when n = 40, 402 + 40 + 41 = 40(40 + 1) + 41 is divisible by 41, and certainly when n = 41, 412 + 41 + 41 is clearly divisible by 41.
The incredible formula n2 - 79n + 1601 was discovered, which produces 80 primes for the consecutive values n = 0 to 79. The product of the coefficients, -79 and 1601, is -126479.
Considering quadratics of the form:
where |n| is the modulus/absolute value of ne.g. |11| = 11 and |-4| = 4
Find the product of the coefficients, a and b, for the quadratic expression that produces the maximum number of primes for consecutive values of n, starting with n = 0.