Author: Sanjay C/Danny Tunitis
Can you convert the number 42 (base 10) to binary (base 2)?
Hint 1
Submit your answer in our competition's flag format. For example, if your answer was '11111', you would submit 'picoCTF{11111}' as the flag.You can either just use an online converter or take that as an oppurtunity to recap binary numbers.
I wrote a script to change the base of a number some time ago so I used that.
There are a lot of tutorials how to do that online. However a short summary:
Binary numbers can be represented in decimal as + + + +
Analogous the change from decimal to binary can be done by calculating the prefactors. This can be done using the logarithm to base two.
Some prerequisites for the calculation:
with and being logarithms to any base.
⌊x⌋ denotes the floor function: E.g. ⌊2.8⌋=2, ⌊2.1⌋=2;
So the 1st, 3rd and 5th bit are one, the remaining bits are all zero:
101010
Note: Bits are counted from right to left and include the 0th bit
Show flag
picoCTF{101010}