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, 03.07.2019 14:10
Amass of 1.5 kg of air at 120 kpa and 24°c is contained in a gas-tight, frictionless piston-cylinder device. the air is now compressed to a final pressure of 720 kpa. during the process, heat is transferred from the air such that the temperature inside the cylinder remains constant. calculate the boundary work input during this process.
Answers: 2
question
Engineering, 04.07.2019 18:10
The filament of an incandescent lamp has a temperature of 2000k. calculate the fraction of radiation emitted in the visible light band if the filament is approximated as blackbody
Answers: 2
question
Engineering, 04.07.2019 18:10
You are making beer. the first step is filling the glass carboy with the liquid wort. the internal diameter of the carboy is 15 in., and you wish to fill it up to a depth of 2 ft. if your wort is drawn from the kettle using a siphon process that flows at 3 gpm, how long will it take to fill?
Answers: 1
question
Engineering, 04.07.2019 18:20
Modern high speed trains do not have perpendicular expansion gaps where rails are joined end-to-end any more they are mostly welded together but what might happen if there was a spell of particularly hot weather that causes inspection of the tracks?
Answers: 1
You know the right answer?
Enigma - The electro-mechanical cipher machine was developed to protect communication in the mid-20t...
Questions
question
Computers and Technology, 18.10.2021 21:20
question
Mathematics, 18.10.2021 21:20
question
Mathematics, 18.10.2021 21:20
question
History, 18.10.2021 21:20
question
Physics, 18.10.2021 21:20
question
Mathematics, 18.10.2021 21:20
Questions on the website: 13722361