10. Two integers r, y are called coprime if the only positive number that divides both...
please post clear picture or solution. Bonus question: 4 bonus marks] A positive integer r is called powerful if for all prime numbers P, p implies p | r. A positive integer z is called a perfect power if there exist a prime number p and a natural number n such that p". An Achilles number is one that is powerful but is not a perfect power. For example, 72 is an Achilles number. Prove that if a and b...
1. (2 marks) Let S 2,3,4,5,6,7,8,9, 10, 11, 12). Let r be the relation on the set S defined as follows: Va,bE S, arb if and only if every prime number that divides a is a factor of b and a S b. The relation T is a partial order relation (you do not need to prove this). Draw the Hasse diagram for T 1. (2 marks) Let S 2,3,4,5,6,7,8,9, 10, 11, 12). Let r be the relation on the...
10. A natural number n is called attainable if there exists non-negative integers a and b such that n - 5a + 8b. Otherwise, n is called unattainable. Construct an 9 x 6 matrix whose rows are indexed by the integers between 0 and 8 and whose columns are indexed by the integers between 0 and 5 whose (x, y)-th entry equals 5x + 8y for any 0 < r < 8 and (a) Mark down all the attainable numbers...
8. [10 points) Consider the following algorithm procedure Algorithm(: integer, n: positive integer; 81,...a s integers with vhilei<r print (l, r, mı, arn, 》 if z > am then 1:= m + 1 if za then anstwer-1 return answer 18 and the (a) Assume that this algorithm receives as input the numbersz-32 and corresponding sequence of integers 2 | 3 1 1 4151617| 8| 9 | 10 İ 11 İ 12 | 13 | 14|15 | 16 | 17 |...
6. For a positive real number z, the difference 1.-z- is called the fractional part of r. Given arbitrary positive real numbers a and b, state a condition in terms of the fractional parts of and that is necessary and sufficient for la + bl = lal + Ibl Prove that this equation is true if and only if your condition holds. 7. Evaluate 10002+4 23k+5 k- 2 algebraically and simplify as much as possible. You ust show all steps....
Java question for two classes: Given the upper limit n as a parameter, the result of both methods is a boolean[] array of n elements that reveals the answers to that problem for all natural numbers below n in one swoop. public static boolean[] sumOfTwoDistinctSquares(int n) Determines which natural numbers can be expressed in the form a 2 + b 2 so that a and b are two distinct positive integers. In the boolean array returned as result, the i...
FindGCF.py 1 #The Greatest Common Factor (GCF) of two numbers is the 2 #largest number that divides evenly into those two 3 #numbers. For example, the Greatest Common Factor of 48 4 #and 18 is 6. 6 is the largest number that divides evenly 5 #into 48 (48 / 6 = 8) and 18 (18 / 6 = 3). 6 # 7 #Write a function called find gcf. find gcf should have 8 #two parameters, both integers. find_gcf should return...
Part B (BI). Implement a Red-Black tree with only operation Insert(). Your program should read from a file that contain positive integers and should insert those numbers into the RB tree in that order. Note that the input file will only contain distinct integers. Print your tree by level using positive values for Black color and negative values for Red color Do not print out null nodes. Format for a node: <Node_value>, <Parent_value>). For example, the following tree is represented...
C++ OPTION A (Basic): Complex Numbers A complex number, c, is an ordered pair of real numbers (doubles). For example, for any two real numbers, s and t, we can form the complex number: This is only part of what makes a complex number complex. Another important aspect is the definition of special rules for adding, multiplying, dividing, etc. these ordered pairs. Complex numbers are more than simply x-y coordinates because of these operations. Examples of complex numbers in this...
Infinite Spiral of Numbers (due 17 Feb 2020) HELLO, WE ARE USING PYTHON 3 TO COMPLETE THIS PROJECT!! PLEASE FOLLOW CODE SKELETON AS GIVEN AT THE END. THIS IS DUE 17TH FEB 2020, ANY AND ALL HELP WOULD BE GREATLY APPRECIATED, THANK YOU! Consider the natural numbers laid out in a square spiral, with 1 occupying the center of the spiral. The central 11 x 11 subset of that spiral is shown in the table below. 111 112 113 114...