Total Assassination

Let a a and b b be coprime positive integers such that a + b = 400 a + b = 400 . How many pairs of ( a , b ) (a,b) are there such that 0 < a b < 1 0 < \frac ab < 1 is fulfilled?


The answer is 80.

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.

2 solutions

0 < a b < 1 0<\frac{a}{b}<1 \implies

{ 0 < a < b a + b = 400 \begin{cases} 0<a<b \\ a+b=400\\ \end{cases}

0 < a < 200 \implies 0<a<200

Also,

g c d ( a , b ) = 1 g c d ( a , 400 a ) = g c d ( a , 400 ) = 1 gcd(a,b)=1 \implies gcd(a,400-a)=gcd(a,400)=1 \implies

{ g c d ( a , 400 ) = 1 0 < a < 200 \begin{cases} gcd(a,400)=1\\ 0<a<200\\ \end{cases}

\implies

{ g c d ( a , 200 ) = 1 0 < a < 200 \begin{cases} gcd(a,200)=1\\ 0<a<200\\ \end{cases}

So, we need to calculate the Euler totient function for 200 200

ϕ ( 200 ) = 80 \phi(200)=80

Kyle T
Feb 22, 2019

<?php
$c = 0;
for($a=1;$a<=399;$a++){
for($b=$a+1;$b<=399;$b++){
if($a+$b==400 && gcd($a,$b)==1){
$c++;
}
}
}
echo $c; //prints 80



function gcd($a,$b) {
return ($a % $b) ? gcd($b,$a % $b) : $b;
}
?>

What's The Fonts There?

Shuvodip Das - 2 years, 3 months ago

0 pending reports

×

Problem Loading...

Note Loading...

Set Loading...