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

The World Wide Web And Databases International Workshop Webdb 98 Valencia Spain March 27 28 1998 Selected Papers Lncs 1590

Authors: Paolo Atzeni ,Alberto Mendelzon ,Giansalvatore Mecca

1st Edition

3540658904, 978-3540658900

More Books

Students also viewed these Databases questions

Question

Discuss how we best understand and control pain.

Answered: 1 week ago