Brain Teasers
Number Trick...
Professor X has managed to create a simple program that can multiply any two whole numbers and calculate the answer correctly.
But, a problem has arisen....it seems the program will NOT correctly multiply a number by itself (such as 4 X 4).
Fortunately, the professor knows a way to get around this glitch.
Keeping in mind that the program must accept ANY whole integer, do you know a way to have the program multiply the numbers in a different way to get the correct result?
This method only has to work when multiplying a number by itself.
But, a problem has arisen....it seems the program will NOT correctly multiply a number by itself (such as 4 X 4).
Fortunately, the professor knows a way to get around this glitch.
Keeping in mind that the program must accept ANY whole integer, do you know a way to have the program multiply the numbers in a different way to get the correct result?
This method only has to work when multiplying a number by itself.
Answer
Here's a neat trick to calculate any given number multiplied by itself:Take one less than the given number and multiply it by one greater than the given number and add 1.
For example:
25 X 25 = 625
24 X 26 = 624 + 1 = 625
It also works for negative numbers:
-1 X -1 = 1
-2 X 0 + 1 = 1
The mathematical formula that the professor should use would be:
(n = given integer)
(n + 1) X (n - 1) + 1
This would be equivalent to n X n.
Hide Answer Show Answer
What Next?
View a Similar Brain Teaser...
If you become a registered user you can vote on this brain teaser, keep track of which ones you have seen, and even make your own.
Solve a Puzzle
Comments
Well like for 4X4 I said U would type in 2X4 then take that answer and times it by 2. But it just wouldn't work on prime numbers like 5,7,11,13... But I still really like your teaser. I never knew U could do that! Good 1!
-luvupurple
-luvupurple
I thought 1/2 one number and double the other, like 4*4 would be 2*8. Your answers better though, I never noticed that before.
thanks for this useful tip. smile
Sorry, but the question was:
do you know a way to have THE PROGRAM multiply the numbers in a different way to get the correct result?
In the proposed solution, it is not THE PROGRAM which adds or subtracts 1. THE PROGRAM can only multiply.
As stated, the teaser does not have a solution.
If the wording of the question is changed to something like:
What is the easiest way to use the program to find the correct value of the square of a number?
the answer is:
Put a zero at the end of one of the multiplicands, then remove the zero from the end of the product.
For example 4x4 (human action) 4x40 (program action) 160 (human action) 16
do you know a way to have THE PROGRAM multiply the numbers in a different way to get the correct result?
In the proposed solution, it is not THE PROGRAM which adds or subtracts 1. THE PROGRAM can only multiply.
As stated, the teaser does not have a solution.
If the wording of the question is changed to something like:
What is the easiest way to use the program to find the correct value of the square of a number?
the answer is:
Put a zero at the end of one of the multiplicands, then remove the zero from the end of the product.
For example 4x4 (human action) 4x40 (program action) 160 (human action) 16
(n - 1)(n + 1) = n^2 - 1. of course to get n^2 you have to add 1 to (n - 1)(n + 1).
you can even use (n - 2)(n + 2) = n^2 - 4. in this case, you have to add 4.
canu has a point. his solution looks simpler but wxscooter's solution is cooler. makes you think hmmm...
but in either solutions, the program will not give you the correct answer.
you can even use (n - 2)(n + 2) = n^2 - 4. in this case, you have to add 4.
canu has a point. his solution looks simpler but wxscooter's solution is cooler. makes you think hmmm...
but in either solutions, the program will not give you the correct answer.
but it never says in the teaser that you can add... good thought though.
I knew the answer immediately because this is the reverse of a trick I've used for multiplying different numbers in my head since I was in 7th grade.
By memorizing the squares of all of the numbers up to X, you can multiply any two numbers whose average value is less than or equal to X using simple addition and subtraction.
In 7th grade I memorized all the squares up to 51, and now know most of them up to 100+. However, it is also easy to calculate squares from nearby squares using the same principle.
I'll explain how it works and demonstrate multiplying 67 x 83:
First find the average of the two numbers, rounded down, by finding half their difference, rounded down (83 - 67 = 16; 16/2 = and adding this to the smaller number (67 + 8 = 75).
Take the square of the average (75^2 = 5625) and subtract the square of half the difference (8^2=64; 5625 - 64 = 5561).
If one number is even and one number is odd (i.e. the difference was rounded down), then add the smaller number to this total.
The result is the product of the two numbers. 67 x 83 = 5561
By the way, say you didn't know what 75^2 was. You can use this trick in reverse to easily calculate the square of numbers ending in 5:
70 x 80 + 25 = 5625
Assuming the addition and subtraction in your head is not a problem, if you practice this you can get extremely quick at multiplying two-digit numbers.
Sometimes you can use this to multiply larger numbers if the difference between the numbers is not too large and the average is close to a value ending in zero (last digit is 9, 0 or 1).
For example, to multiply: 687 x 735
Find half the difference (13+35=48; 48/2=24) add it to the smaller number (687+24=711). If the last digit is 9, then add 1. Drop the last digit (71), and take the square (71^2=5041). Put the zeros back (504100) and subtract the square of half the difference (24^2=576; 504100-576=504100-600+24=503524).
If the last digit was 9 and you added one, subtract both numbers and subtract 1.
If the last digit you dropped was 1, then add both numbers (503524+700-13=504211; 504211+735=504946) and subtract 1 (504946-1=504945).
The result is the product. 687 x 735 = 504945
By the way, if you didn't know what 71^2 was, then use 70^2+70+71=4900+141=5041. The difference between the square of two adjacent numbers is the sum of the two numbers.
Most of the time, doing multiplication in my head using these and other techniques is faster than picking up and using a calculator.
By memorizing the squares of all of the numbers up to X, you can multiply any two numbers whose average value is less than or equal to X using simple addition and subtraction.
In 7th grade I memorized all the squares up to 51, and now know most of them up to 100+. However, it is also easy to calculate squares from nearby squares using the same principle.
I'll explain how it works and demonstrate multiplying 67 x 83:
First find the average of the two numbers, rounded down, by finding half their difference, rounded down (83 - 67 = 16; 16/2 = and adding this to the smaller number (67 + 8 = 75).
Take the square of the average (75^2 = 5625) and subtract the square of half the difference (8^2=64; 5625 - 64 = 5561).
If one number is even and one number is odd (i.e. the difference was rounded down), then add the smaller number to this total.
The result is the product of the two numbers. 67 x 83 = 5561
By the way, say you didn't know what 75^2 was. You can use this trick in reverse to easily calculate the square of numbers ending in 5:
70 x 80 + 25 = 5625
Assuming the addition and subtraction in your head is not a problem, if you practice this you can get extremely quick at multiplying two-digit numbers.
Sometimes you can use this to multiply larger numbers if the difference between the numbers is not too large and the average is close to a value ending in zero (last digit is 9, 0 or 1).
For example, to multiply: 687 x 735
Find half the difference (13+35=48; 48/2=24) add it to the smaller number (687+24=711). If the last digit is 9, then add 1. Drop the last digit (71), and take the square (71^2=5041). Put the zeros back (504100) and subtract the square of half the difference (24^2=576; 504100-576=504100-600+24=503524).
If the last digit was 9 and you added one, subtract both numbers and subtract 1.
If the last digit you dropped was 1, then add both numbers (503524+700-13=504211; 504211+735=504946) and subtract 1 (504946-1=504945).
The result is the product. 687 x 735 = 504945
By the way, if you didn't know what 71^2 was, then use 70^2+70+71=4900+141=5041. The difference between the square of two adjacent numbers is the sum of the two numbers.
Most of the time, doing multiplication in my head using these and other techniques is faster than picking up and using a calculator.
It is a neat number trick but once you allow the operator to do mental arithmetic as well as operate the program (ie add one and subtract one) the teaser becomes meaningless. For example you could multiply a number by its double then halve the answer.eg to multiply 25 x 25 get the program to do 25 x 50 = 1250 and halve the answer 625.
To post a comment, please create an account and sign in.
Follow Braingle!