subject
Engineering, 22.02.2021 19:40 loveuncondition

Enigma - The electro-mechanical cipher machine was developed to protect communication in the mid-20th century. Following the principles of the Enigma, a modified Enigma machine is developed having rotorCount rotors labeled from 1 to rotorCount. Each rotor has a value that can be set between minRotorValue and maxRotorValue, inclusive. To make the machine work, the values set in the 2 through rotorCount rotors should have a greatest common divisor with rotor 1 of 1. In other words, they should be set to a number that is coprime with the setting of rotor 1. Calculate the number of possible configurationin which rotor can be set. For example,
RotorCount = 3, minRotorValue = 2, maxRotorValue = 3
Possible Combination = (2,3,3), (3,2,2), (3,2,4), (3,4,2), (3,4,4), (4,3,3)
All other combination are invalid, as they are not coprimes with rotor 1.
Input Type: RotorCount, minRotorValue, maxRotorValue
Output: No of valid combinations
Sample Input1: 2, 1, 3
Output: 7
Sample Input 2: 3, 2, 6
Output: 34

ansver
Answers: 3

Another question on Engineering

question
Engineering, 04.07.2019 18:10
During a steady flow process, the change of energy with respect to time is zero. a)- true b)- false
Answers: 2
question
Engineering, 04.07.2019 18:10
Condition monitoring is a major component of. (clo4) a)- predictive maintenance. b)-preventive maintenance c)-proactive maintenance d)-reactive maintenance.
Answers: 1
question
Engineering, 04.07.2019 18:10
An air compression refrigeration system is to have an air pressure of 100 psia in the brine tank and an allowable air temperature increase of 60°f for standard vapor compression cycle temperatures of 77 f entering the expansion cylinder and 14 f entering the compression cylinder, calculate the coefficient of performance a. 2.5 b 3.3 c. 4.0 d. 5.0
Answers: 3
question
Engineering, 04.07.2019 18:20
Ahe-xe mixture containing a 0.75 mole fraction of helium is used for cooling electronics in an avionics application. at a temperature of 300 k and atmospheric pressure, calculate the mass fraction of helium and the mass density, molar concentration and molecular weight of the mixture. if the cooling capacity is 10 l, what is the mass of the coolant?
Answers: 3
You know the right answer?
Enigma - The electro-mechanical cipher machine was developed to protect communication in the mid-20t...
Questions
question
Mathematics, 15.10.2019 07:00
Questions on the website: 13722363