Data Structures & AlgorithmsHardGATE CS · ICPC regional
What is the multiplicative order of 2 modulo 17 (the smallest k > 0 with 2^k ≡ 1 mod 17)?
- A. 9
- B. 10
- C. 8
- D. 12
Correct answer: C. 8
The powers of 2 modulo 17 cycle as 2, 4, 8, 16, 15, 13, 9, 1, so the order is 8. The order always divides phi(17) = 16.
Practise more Arrays, Strings, Linked Lists, Stacks, Queues and Hashing questionsArrays, Strings, Linked Lists, Stacks, Queues and Hashing: notes and key points
More Arrays, Strings, Linked Lists, Stacks, Queues and Hashing questions
- How many integers x in [1, 100] can be written as a^2 + b^2 with positive integers a and b?
- What is 2^100 mod 7?
- Every element of the circular array [1, 2, 3, 4] is replaced by the sum of its two circular neighbours, taken modulo 10, simultaneously…
- How many pairs a < b with 1 <= a < b <= 12 satisfy gcd(a, b) = b - a?
- How many integers n in [1, 60] satisfy n^2 - n divisible by 6?
- What is the length of the longest contiguous subarray of [4, 3, 2, 6, 1, 5] whose sum is at most 10?