ChaseDream
标题: DS数论难题 [打印本页]
作者: Jiamisnm 时间: 2023-9-11 20:30
标题: DS数论难题
求助大佬们一道DS题!!!
If x and y are positive integers such that x = 8y +12, what is the greatest common divisor of x and y?
- (1)x = 12u, where u is an integer.
- (2)y= 12z, where z is an integer.
作者: tankhuang 时间: 2024-1-8 20:35
搬运外网解答:
Statement 1: x=12u, where u is an integer and x=8y+12.
In other words, x is a multiple of 12.
For x to be a multiple of 12, 8y must be a multiple of 12.
If y=3, then x = 8*3 + 12 = 36.
The GCD of 3 and 36 is 3.
If y=6, then x = 8*6 + 12 = 60.
The GCD of 6 and 60 is 6.
Since the GCD can be different values, INSUFFICIENT.
Statement 2: y=12z, where z is an integer and x=8y+12.
In other words, y is a multiple of 12.
Since we're looking for the GCD, view x in terms of its FACTORS.
If y=12, then x = 8(12) + 12 = 12(8+1) = 12*9.
The GCD of 12 and 12*9 is 12.
If y=24, then x = 8(24) + 12 = 12(8*2 + 1) = 12*17.
The GCD of 24 and 12*17 is 12.
欢迎光临 ChaseDream (https://forum.chasedream.com/) |
Powered by Discuz! X3.3 |