Ratna Banjara wrote:
 The number 124 has the property that it is the smallest number whose
first three multiples contain the digit 2. Observe that
124*1 = 124, 124*2 = 248, 124*3 = 372 and that 124, 248 and 372 each
contain the digit 2. It is possible to generalize this property to be
the smallest number whose first n multiples each contain the digit 2.
Write a function named smallest(n) that returns the smallest number
whose first n multiples contain the digit 2. Hint: use modulo base 10
arithmetic to examine digits.

Its signature is
int smallest(int n)

You may assume that such a number is computable on a 32 bit machine,
i.e, you do not have to detect integer overflow in your answer.

Do you have a Python question, or would you just like us to do your homework for you?

This is a mailing list for learning Python. Please make an attempt to solve the problem, and if you still have trouble, show us what your code is, what error you get, and we'll try to help you with Python.



--
Steven



_______________________________________________
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor

Reply via email to