If A is a number which divided by 7 give's remainder 1, divided by 9 remainder 1, divided by 64 remainder 3 and 35000<A<40000. Find A

54 Views Asked by At

If x is the number

x=7*p+1

x=9*q+1

x=64*r+3

From the first 2 equations is obvious that

x=63*s+1

The number is

556*63+1 .....

634*63+1

simultaneously has to be

547*64+3 ...

624*64+3

My son wrote a 3 lines Python code and the result is 36163. But a math solution is needed

1

There are 1 best solutions below

0
On BEST ANSWER

The key to the problem is to express $63$ as $(64 - 1).$

Then, $n$ must have form

$$63s + 1 = (64 - 1)s + 1 = 64s + (1 - s).$$

By the constraint of the problem, you then must have that

$$(1 - s) \equiv 3 \pmod{64} \implies s \equiv 62\pmod{64}.$$

So, it is simply a matter of finding the appropriate element $s$ from the set

$$\{62, (62 + [1 \times 64]), (62 + [2 \times 64]), \cdots \},$$

so that $n = 63s + 1$ is in the proper range, as specified by the constraint of the problem.


$$(63 \times 62) + 1 = 3907.$$

$$35000 - 3907 = 31093.$$

$$40000 - 3907 = 36093.$$

Each time that $s$ is replaced by $s + 64$, the product $63(s)$ changes to $63(s + 64)$, which is an increase of $(63 \times 64) = 4032.$

So, you must increase $s$ from $(62)$ to $62 + a(64),$ where the variable $a$ is chosen so that

$$31093 \leq 63(a \times 64) \leq 36093.$$

Notice that:

$$31093 = (4032 \times 7) + 2869.$$

$$36093 = (4032 \times 8) + 3837.$$

So, you want $$s = 62 + (8 \times 64) = 574.$$

This implies that

$$n = (63s + 1) = (63 \times 574) + 1 = 36163.$$