COMPUTER PROBLEMS: DAY 9 (1) Find all solutions to Pell’s equation x

advertisement
COMPUTER PROBLEMS:
DAY 9
(1) Find all solutions to Pell’s equation x2 − 2y 2 = 1 with 0 ≤ x ≤ 200 and
0 ≤ y ≤ 200.
(2) Write a python program that looks for solutions of Pell’s equation by checking
if 1 + 2y 2 is a square. Find all solutions with y ≤ 10000.
(3) Write a program to find solutions to x2 − Ny 2 = 1.
(4) Write a code that looks for positive integer solutions to x2 + y 2 = z 2 , x3 + y 3 =
z 3 and to x3 + y 3 + z 3 = w 3 .
(5) Write code that expands a number in to a continued fraction. e.g. π →
[3, 7, 15, 1, 292, . . .].
√
√
(6) Find the continued fraction expansion for (1 + 5)/2 and for 97.
(7) Write a program that checks by brute force if −1 is a square modp. Try this
for all primes less than or equal to 103. Do you see a pattern?
(8) Write a code that checks if a number a is the sum of 2 squares.
(9) Which numbers less than or equal to 100 are the sum of 2 squares? Can you
see the pattern?
1
Download