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

Home > Just Math
Minimum Integer (Posted on 2014-02-28) Difficulty: 3 of 5
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.)
Some Thoughts 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 (13)
Unsolved Problems
Top Rated Problems
This month's top
Most Commented On

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