Attachment 'chap6-advanced_exercises.rst'
DownloadChapter 6: More advanced exercises
You will find in this tutorial a collection of more advanced exercises. You might also want to have a look at the worksheets on "Collatz conjecture", "Dictionaries and graph theory" and "Strings and the Burrows-Wheeler transform".
Exercise 6.1
How many strings of length n containing only letters a and b but not containing aa are there? Compute the value for each n = 1, 2, ..., 10
Do you know this sequence?
Could you find the corresponding entry in the OEIS
Exercise 6.2 (Goldbach conjecture)
Verify experimentally the following statement: « For each even integer n ≥ 4, there exist two prime number p ≥ 2 and q ≥ 2 such that n = p + q ».
Up to which value of n are you able to verify this conjecture?
Exercise 6.3
Does there exist two positive integer numbers x and y such that x2 − 61y2 = 1 ?
Exercise 6.4
Write a function that given positive integers (p, q, n) return the number of solutions in positive integers (a1, a2, …, an) to the equation
How many solutions are there for (p, q, n) = (13, 12, 3)?
A sample of Euler problems
Solve the following Euler problems
- problem 26 (decimal expansions)
- problem 31 (coin sums)
- problem 45 (triangular, pentagonal and hexagonal numbers)
- problem 46 (odd composite number that can not be written as the sum of a prime and twice a square)
- problem 50 (sum of consecutive primes that are primes)
Attached Files
To refer to attachments on a page, use attachment:filename, as shown below in the list of files. Do NOT use the URL of the [get] link, since this is subject to change and can break easily.You are not allowed to attach a file to this page.