GATE Computer ScienceModerateGATE CS (PYQ pattern)
For how many integers n with 2 ≤ n ≤ 30 does the fraction 1/n have a terminating representation in base 6 but a non-terminating one in base 10?
- A. 11
- B. 7
- C. 4
- D. 9
Correct answer: B. 7
1/n terminates in base b exactly when every prime factor of n divides b. Base 6 needs n = 2^a·3^b (> 1): 2, 3, 4, 6, 8, 9, 12, 16, 18, 24, 27 (11 values). Base 10 needs n = 2^a·5^c; among the 11, the powers of 2 (2, 4, 8, 16) also terminate in base 10. 11 − 4 = 7: 3, 6, 9, 12, 18, 24, 27.
More Digital Logic questions
- Values from −1000 to +1000 must be stored with a resolution of at least 0.0001. Design (i) is a two's complement binary fixed-point format…
- How many 8-bit patterns have no two adjacent 1 bits and an even number of 1 bits?
- A memory word uses the (72, 64) SEC-DED code: a Hamming code with 7 check bits over the 64 data bits (71 bits in all), plus an overall…
- An (8, 4) SEC-DED code uses even-parity Hamming bits at positions 1, 2, 4, data bits d1..d4 at positions 3, 5, 6, 7 (positions numbered…
- A binary block code has minimum Hamming distance 6. A decoder must correct every pattern of up to 1 bit error and, at the same time…
- A binary (n, k) code correcting t errors is perfect if the radius-t spheres around its 2^k codewords exactly fill all 2^n words. Which of…