01/10/2018, 11:50

Cần giúp bài tập tìm bộ 3 số Pythagore

Tìm các bộ ba số tự nhiên x,y,z thỏa 1<= x,y,z <= 10000 và
thỏa mãn x 2 + y 2 = z 2 . Ví dụ {6,8,10} là một bộ nghiệm thỏa
mãn.

rogp10 viết 14:00 ngày 01/10/2018

Công thức: cho u > v:
x = u^2 - v^2
y = 2uv
z = u^2 + v^2

Đặt cận trên z.

Nhat Minh viết 13:55 ngày 01/10/2018

bác giải thích cho em rõ hơn tại sao ra đc thế ko ạ

HK boy viết 14:00 ngày 01/10/2018

Vì ở đây có nói:

en.wikipedia.org

Pythagorean triple

A Pythagorean triple consists of three positive integers a, b, and c, such that a2 + b2 = c2. Such a triple is commonly written (a, b, c), and a well-known example is (3, 4, 5). If (a, b, c) is a Pythagorean triple, then so is (ka, kb, kc) for any positive integer k. A primitive Pythagorean triple is one in which a, b and c are coprime (that is, they have no common divisor larger than 1). A triangle whose sides form a Pythagorean triple is called a Pythagorean triangle, and is necessarily a ri Th...

Bài liên quan
0