Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write a program either in C or Java threads, which calculates the inverse of the totient-Function for the number 999. The totient-Function returns the number

image text in transcribed
Write a program either in C or Java threads, which calculates the inverse of the totient-Function for the number 999. The totient-Function returns the number of elements that are co-prime to 999. Co-prime to 999 means that the Greatest Common Divisor of 999 and number x, smaller than 999 , is equal to 1 . Hence, the inverse should return the number of elements that are not coprime to 999. Example: totient-Function (8)=4; inverse of totient-Function (8)=3. Because only four numbers smaller than 8 , have 1 as the Greatest Common Divisor with 8 , namely 1,3,5 and 7 . The other numbers smaller than 8 , namely 2,4,6, have 2 and 4 as the Greatest Common Divisor with 8 . Pseudo Code for Greatest Common Divisor: GCD(a,b) if b==0 return a else return GCD(b,(a%b))

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Object Databases The Essentials

Authors: Mary E. S. Loomis

1st Edition

020156341X, 978-0201563412

More Books

Students also viewed these Databases questions