0

Hi guys! Write a code to get number of coprimes to a given number less than the given number

COPRIME: If gcd of two numbers is 1,then they are coprimes eg: 9 is given no. then answer is 6. (1,2,4,5,7,8)

28th Sep 2017, 2:59 AM
Shashank Keerthi
Shashank Keerthi - avatar
11 Réponses
28th Sep 2017, 4:17 AM
Azam
Azam - avatar
+ 1
as we input 15 what should be output 14 , 17 or 2?
28th Sep 2017, 3:32 AM
Azam
Azam - avatar
0
It may have many coprimes what you want least or largest or close to number greater, smaller
28th Sep 2017, 3:30 AM
Azam
Azam - avatar
0
less than given no.
28th Sep 2017, 3:33 AM
Shashank Keerthi
Shashank Keerthi - avatar
0
for input 15answer should be8
28th Sep 2017, 3:41 AM
Shashank Keerthi
Shashank Keerthi - avatar
0
15 and 14 also coprimes dear then why should be 8 15 and 13 15 and 11 can you tell me why 8 ?? as above given pairs are coprimes.
28th Sep 2017, 4:02 AM
Azam
Azam - avatar
0
15-1,2,4,7,8,11,13,14 are coprimes total 8
28th Sep 2017, 4:04 AM
Shashank Keerthi
Shashank Keerthi - avatar
0
okay okay I got it.
28th Sep 2017, 4:05 AM
Azam
Azam - avatar
0
I think You edited your question. well, I try and just wait.
28th Sep 2017, 4:06 AM
Azam
Azam - avatar
0
Tanq very much
28th Sep 2017, 4:07 AM
Shashank Keerthi
Shashank Keerthi - avatar
28th Sep 2017, 3:13 PM
VcC
VcC - avatar