0

Here's how the puzzle works!

Here is a list of numbers : $1,2,3,4,5,6,7,8,9$

I will give you some numbers in this list (numbers can be repeated). When receiving those numbers, you will multiply them and then find if the tens digit has a $0$. You just need to say if the new number has a $0$ in its tens digits.

Ok now, have you got a way to quickly find out if this number has a $0$ in the tens digit without just verify after multiply them ?

For example, i will give you $2,6,9$. When multiply, i get $108$. So it has a $0$ in the tens digits !

However for $2,3,3,4,4,4,5,8,8,9,9$ we get after multiplication $29 859 840$. So it hasn't a $0$ in the tens digits.

Honestly, I don't know if there is an easy way or not.

EDIT : As mentioned in the commentaries, the use of modulo makes the problem more effective. But it is still a problem when dealing with a lot of numbers. We must continue to calculate with a mod $100$ which makes the work easier. Even so, isn't there a more effective way?

  • 2
    Just do the multiplication $\pmod {100}$... you never have to do worse than multiply a two digit number by a one digit number. – lulu Jul 22 '20 at 19:30
  • 1
    Calculate modulo $100$, that is drop everything above tens after each multipliccation: $2\cdot 3=6$, $6\cdot 3=18$, $18\cdot 4 = 72$, $72\cdot 4 = 288$, drop $200$, $88\cdot 4 = 352$, drop $300$, $52\cdot 5= 260$, drop $200$, $60\cdot 8=480$, $80\cdot 8=640$, $40\cdot 9=360$ and finally $60\cdot 9=540$, and $40$ has no zero in tens. Of course – if you can multiply two-digit numbers mentally...... – CiaPan Jul 22 '20 at 19:31
  • 1
    If you store the numbers modulo 10 and 100 in the ranges $(-4,5)$ and $(-49,50)$, then you never have to do worse than multiply a two-digit number less than or equal to $50$ by a one-digit number less than or equal to $5$. – Théophile Jul 22 '20 at 19:54
  • 1
    If you have too many numbers, then place them as the leaves of a tree (with nodes that ramify in at most two branches) as if a quick sort should be applied, then build products w.r.t. the structure of the tree mod 100. – dan_fulea Jul 22 '20 at 19:57
  • 2
    "Isn't there a more effective way": One thing to realize is that "the tens digit" is not a particularly simple property of a number as the number. It's more a property of the way we frequently represent it as a string of digits. It will be about as easy or hard to answer "is the digit before last zero when the product is written in base 14?" The mathematical representation of "the tens digit of $n$" is $$\left\lfloor \frac{n}{10} \right\rfloor - 10 \left\lfloor \frac{n}{100} \right\rfloor$$ which is not very simple to manipulate. – aschepler Jul 22 '20 at 20:02

0 Answers0