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
Courses that are developed by subject matter experts, internal or extemal to the college or university. these programs are marketed by the school (clo2) marks a)-vocational schools b)-vendor training c)-colleges & universities d)-continuing education programs
Answers: 2
question
Engineering, 04.07.2019 18:20
What is the heat treatment of metals? what is the benefit of it? why and how it's useful? answer in details, do not write by hand.
Answers: 3
question
Engineering, 04.07.2019 19:10
In general, how do thermosetting plastics compare to thermoplastics in mechanical and physical properties?
Answers: 3
question
Engineering, 04.07.2019 19:10
Asteel wire of 2 mm diameter is fixed between two points located 2 m apart. the tensile force in the wire is 250n, if its density of steel is given by 7830 kg/m3 the fundamental frequency of vibration hz? ?
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, 02.04.2020 01:18
question
Mathematics, 02.04.2020 01:18
question
Social Studies, 02.04.2020 01:18
question
Mathematics, 02.04.2020 01:18