All about flooble | fun stuff | Get a free chatterbox | Free JavaScript | Avatars
 perplexus dot info

 Minimum Integer (Posted on 2014-02-28)
Determine the smallest positive integer whose first 6 multiples (including itself) contain the digit 2.

 No Solution Yet Submitted by K Sengupta No Rating

Comments: ( Back to comment list | You must be logged in to post comments.)
 re(2): Brute force solution | Comment 3 of 4 |
(In reply to re: Brute force solution by Charlie)

Hi Charlie,

The extent of the While, For, and If statements are all determined by the indentation of the code (is it not appearing indented to you?  It looks ok on my screen but maybe it's formatted differently in different browsers or something?)

If it helps clarify I'll add some comments (indicated by the # sign) to indicate where things stop:

num = 2
ans = 0

WHILE ans == 0:
ans = num
FOR m in range(1,7):
mult = num * m
IF '2' not in list(str(mult)):
ans = 0
break

# END IF
# END FOR LOOP

num += 1

# END WHILE LOOP

print ans, ans*2, ans*3, ans*4, ans*5, ans*6

 Posted by tomarken on 2014-02-28 13:33:13
Please log in:
 Login: Password: Remember me: Sign up! | Forgot password

 Search: Search body:
Forums (0)
Newest Problems
Random Problem
FAQ | About This Site
Site Statistics
New Comments (4)
Unsolved Problems
Top Rated Problems
This month's top
Most Commented On

Chatterbox:
Copyright © 2002 - 2019 by Animus Pactum Consulting. All rights reserved. Privacy Information