Write and test a c implementation of the mobius function

Assignment Help Computer Engineering
Reference no: EM132214030

Write and test a C implementation of the Mobius function M(n) defined as follows

M(n) = 1 if n = 1

= 0 if any prime factor is contained in N more than once

= (-1)p if n is the product of p different prime factors

Examples

M(78) = -1 78 = 2 * 3 * 13

M(34) = 1 34 = 2 * 17

M(45) = 0 45 = 3 * 3 * 5

The first values of M(n) are shown in this table n 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20

M(n) 1 -1 -1 0 -1 1 -1 0 0 1 -1 0 -1 1 1 0 -1 0 -1 0

Extra credit: Using random numbers, estimate the probabilities that M(n) returns -1, 0, +1

Reference no: EM132214030

Questions Cloud

Find the cyclic rotation that is the smallest lexicographic : Write a SuffixArray client that, given a string, finds the cyclic rotation that is the smallest lexicographically in linear time.
Write and test a data structures template : Write the template for an array of capacity =2 (default constructor) of unspecified type.
Calculate the number of elements in an array not counting : MSP430G2553 :Subroutine expects the Input on the stack as shown above: The input is the starting address of an array consisting of word length elements.
Remove occurrences of a given character in a string : Write a subroutine in assembly that removes occurrences of a given character in a string if it is after or before the space.
Write and test a c implementation of the mobius function : Write and test a C implementation of the Mobius function M(n) defined as follows.
Determine your clients net capital gain or net capital loss : HI6028 Taxation Theory, Practice & Law - Advise Rapid-Heat of its FBT consequences arising out of the above information, including calculation of any FBT
Write the assembly language for the subroutine : Write the assembly language for the subroutine (called by a main program) and simulate using the sample data table: 24, 65, F0.
Write a template function that receives a contact vector : Write a main function to test this function. In the main function create three different vectors of the types, int, double and char.
Write a template class which represent a mathematical set : Write a template class called ValSet, which represents a mathematical set of values.

Reviews

Write a Review

Computer Engineering Questions & Answers

  Mathematics in computing

Binary search tree, and postorder and preorder traversal Determine the shortest path in Graph

  Ict governance

ICT is defined as the term of Information and communication technologies, it is diverse set of technical tools and resources used by the government agencies to communicate and produce, circulate, store, and manage all information.

  Implementation of memory management

Assignment covers the following eight topics and explore the implementation of memory management, processes and threads.

  Realize business and organizational data storage

Realize business and organizational data storage and fast access times are much more important than they have ever been. Compare and contrast magnetic tapes, magnetic disks, optical discs

  What is the protocol overhead

What are the advantages of using a compiled language over an interpreted one? Under what circumstances would you select to use an interpreted language?

  Implementation of memory management

Paper describes about memory management. How memory is used in executing programs and its critical support for applications.

  Define open and closed loop control systems

Define open and closed loop cotrol systems.Explain difference between time varying and time invariant control system wth suitable example.

  Prepare a proposal to deploy windows server

Prepare a proposal to deploy Windows Server onto an existing network based on the provided scenario.

  Security policy document project

Analyze security requirements and develop a security policy

  Write a procedure that produces independent stack objects

Write a procedure (make-stack) that produces independent stack objects, using a message-passing style, e.g.

  Define a suitable functional unit

Define a suitable functional unit for a comparative study between two different types of paint.

  Calculate yield to maturity and bond prices

Calculate yield to maturity (YTM) and bond prices

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd