MULTIPLES OF 7
To know whether the number X is a multiple of 7, one can use the following method:
- Remove the last digit of the number;
- Multiply this digit by 5;
- Add the result of the multiplication to the rest of the number;
- If the result of the sum is a multiple of 7, then the original number is also a multiple of 7.
Example with X = 1432:
- Is 1432 a multiple of 7? => 143 + 2 * 5 = 153
- Is 153 a multiple of 7? => 15 + 3 * 5 = 30
- 30 is obviously NOT a multiple of 7, so neither is 1432.
MULTIPLES OF 9
To know whether the number X is a multiple of 9, simply add all the digits of X and check whether the result is a multiple of 9.
Example with X = 3573:
- Is 3573 a multiple of 9? => 3 + 5 + 7 + 3 = 18
- 18 IS a multiple of 9, so 3573 IS a multiple of 9 as well.
MULTIPLES OF 11
To know whether the number X is a multiple of 11, simply alternatively add and remove all the digits of X, then check whether the result is 0 or 11.
Example with X = 6237:
- Is 6237 a multiple of 11? => 6 - 2 + 3 - 7 = 0
- The result being 0, 6237 IS a multiple of 11 for sure.
MULTIPLES OF 13
To know whether the number X is a multiple of 13, one can use the same method as to check the multiples of 7 except that the last digit has to be multiplied by 4 instead of 5.
Example with X = 1586:
- Is 1586 a multiple of 13? => 158 + 6 * 4 = 182
- Is 182 a multiple of 13? => 18 + 2 * 4 = 26
- 26 IS a multiple of 13, so 1586 IS a multiple of 13 as well.
TAXICAB NUMBERS
The Nth taxicab number Ta(N) is the smallest number that can be expressed as a sum of two positive cubes in N distinct ways; here are the first 3 taxicab numbers:
- Ta(1) = 1^3 + 1^3 = 2
- Ta(2) = 1^3 + 12^3 = 9^3 + 10^3 = 1729
- Ta(3) = 167^3 + 436^3 = 228^3 + 423^3 = 255^3 + 414^3 = 87539319
SQUARE ROOT OF A POWER OF 2
The square root of X = 2^N is Y = 2^(N / 2), which can be denoted "1 << (N / 2)" in C language.
Examples:
- 256 = 2^8 => the square root of 256 is 2^4 = 1 << 4 = 16
- 65536 = 2^16 => the square root of 65536 is 2^8 = 1 << 8 = 256
ROT13 ENCODING
Rot13 is a basic substitution cipher: each alphabetic character of the string to be encoded is replaced by the letter 13 places further along in the alphabet, wrapping around if necessary ("A" becomes "N", "M" becomes "Z", etc.). One can use the following lookup table:
A | B | C | D | E | F | G | H | I | J | K | L | M | N | O | P | Q | R | S | T | U | V | W | X | Y | Z |
N | O | P | Q | R | S | T | U | V | W | X | Y | Z | A | B | C | D | E | F | G | H | I | J | K | L | M |
ULTIMATE QUESTION OF LIFE, THE UNIVERSE, AND EVERYTHING
How come you don't know the Hitchhiker's Guide to the Galaxy?!