Three positive integers (a, b, c) with a<b<c are called a
Pythagorean triple if the sum of the square of a and the square of
b is equal to the square of c. Write a program that prints all
Pythagorean triples (one in a line) with a, b, and c all smaller
than 1000, as well the total number of such triples in the end.
Arrays are not allowed to appear in your code. Hint: user nested
loops (Can you...
8.Let a and b be integers and d a positive
integer.
(a) Prove that if d divides a and d divides b, then d divides both
a + b and a − b.
(b) Is the converse of the above true? If so, prove it. If not,
give a specific example of a, b, d showing
that the converse is false.
9. Let a, b, c, m, n be integers. Prove that if a divides each of b
and c,...
Question#1
How many positive integers between 100 and 888 inclusive,
a) are divisible by 7?
b) are odd?
c) have distinct digits?
d) are not divisible by 6?
e) are divisible by either 4 or 7?
f) are not divisible by either 4 or 7?
g) are divisible by 4 but not by 7?
h) are divisible by 4 and 7?
Question#1
How many positive integers between 100 and 888 inclusive,
a) are divisible by 7?
b) are odd?
c)...
Let a and b be positive integers, and let d be their greatest
common divisor. Prove that there are infinitely many integers x and
y such that ax+by = d. Next, given one particular solution x0 and
y0 of this equation, show how to find all the solutions.
The least common multiple of nonzero integers a and b is the
smallest positive integer m such that a|m and b|m. It is denoted
[a, b], or sometimes [a, b] for short. Prove the following:
1) If a|k and b|k, then [a, b]|k.
2) If gcd(a, b) = 1, then [a, b] =ab
3) If c >0,then [ca, cb] =c·[a, b].
4) If a >0 and b >0,then [a, b] =ab / gcd(a, b).
Theorem 3.4. Let a and b be integers, not both zero, and suppose
that b = aq + r
for some integers q and r. Then gcd(b, a) = gcd(a, r).
a) Suppose that for some integer k > d, k | a and k | r. Show
that k | b also. Deduce that k is a common divisor of b and a.
b) Explain how part (a) contradicts the assumption that d =
gcd(b, a).