For every
Dratini
you catch in the wild, you will get 3
Dratini candies
.
For every Dratini you hatched in the wild, you will get 10 Dratini candies.
If I have a total of 25 Dratini candies, how many Dratinis do I have in total?
This section requires Javascript.
You are seeing this because something didn't load right. We suggest you, (a) try
refreshing the page, (b) enabling javascript if it is disabled on your browser and,
finally, (c)
loading the
non-javascript version of this page
. We're sorry about the hassle.
Relevant wiki: Linear Diophantine Equations
Let the number of Dratinis caught be x and the number of Dratinis hatched be y . Therefore, we have,
3 x + 1 0 y = 2 5
As we know that x and y are both non-negative integers. So,
x = 5 , y = 1
Therefore, total Dratinis with Pi Han = 6 .
Why ( x , y ) = ( 5 , 1 ) is the only solution?
Considering the diophantine equation 3 x + 1 0 y = 2 5 , we have g cd ( 3 , 1 0 ) = 1 . So,
1 = 3 ⋅ 7 + 1 0 ⋅ ( − 2 )
Then one solution is x ∗ = 7 ⋅ 2 5 and y ∗ = ( − 2 ) ⋅ 2 5 . And all other solutions are of form,
( x ∗ + m g cd ( 3 , 1 0 ) 1 0 , y ∗ − m g cd ( 3 , 1 0 ) 3 )
or
( 7 ⋅ 2 5 + 1 0 m , − 5 0 − 3 m )
for some integer m .
As per the problem, we need to find the integers that satisfy 7 ⋅ 2 5 + 1 0 m ≥ 0 and − 5 0 − 3 m ≥ 0 , so,
2 − 7 ⋅ 5 ≤ m ≤ 3 − 5 0
The only integer value of m satisfying the above inequality is m = − 1 7 , which yields our solution as:
( x , y ) = ( 7 ⋅ 2 5 + 1 0 ⋅ ( − 1 7 ) , − 5 0 − 3 ⋅ ( − 1 7 ) ) = ( 5 , 1 )