1

What are the rightmost four digits of the binary equivalent of the decimal number 4739685

My approach-

I converted the whole number into its binary equivalent and then checked out the last 4 digits, is there any shorter way to find it directly, I was thinking as in the case of finding last 4 digits in base 10 we do mod 10^4, so is there anything like 2^4 that we can do to find the last 4 digits in this case ? like 4739685 mod 16 ?

Fin27
  • 958
  • 4
    The units place is obvious, right? And you don't need the whole number the figure that out, just the last digit. Similarly... – lulu Nov 14 '21 at 13:13
  • 1
    How do you convert decimal to binary? One of the ways is to first continuously divide by $2$ and record the remainders. e.g., from 29, you have $29 \div 2 = 14 R 1$, $14 \div 2 = 7 R 0$, $7 \div 2 = 3 R 1$, $3 \div 2 = 1 R 1$, $1 \div 2 = 0 R 1$. The remainders are $(1, 0, 1, 1, 1)$. Reverse the sequence to get $(1, 1, 1, 0, 1)$. Then the binary representation is $11101$.

    With this method, notice that we are obtaining the last digit, then the 2nd last digit, then the 3rd last digit, etc. So, to answer this question, simply do four steps to get the last 4 digits (and remember to reverse it).

    – VTand Nov 14 '21 at 13:55
  • @VTand I think you should post your comment as an answer. – Ethan Bolker Nov 14 '21 at 14:20
  • See my comment on albert's answer for a simple general way. – Bill Dubuque Nov 14 '21 at 19:22

1 Answers1

2

Last 4 digits of binary = Last hex-digit of hexadecimal

$10^4 \pmod{16} ≡ 2^4×5^4 \pmod{2^4} ≡ 0$

$4739685 \pmod{16} ≡ 9685-10000 \pmod{16} ≡ -315+320 \pmod{16} ≡ 5$

hex-digit of 5 = binary of 0101

albert chan
  • 2,114