A community for students.
Here's the question you clicked on:
 0 viewing
anonymous
 5 years ago
Can anyone see what is wrong? it worked before :s
http://pastebin.com/hfcpPzCx
i get the print statement 'not found' infinate loop but im sure the last time i tried i got this thing working, as you can see, im looking for 6 consecutive numbers that do not = 6a +9b +20c. to give the highest number in the equation, cheers
anonymous
 5 years ago
Can anyone see what is wrong? it worked before :s http://pastebin.com/hfcpPzCx i get the print statement 'not found' infinate loop but im sure the last time i tried i got this thing working, as you can see, im looking for 6 consecutive numbers that do not = 6a +9b +20c. to give the highest number in the equation, cheers

This Question is Closed

anonymous
 5 years ago
Best ResponseYou've already chosen the best response.0First you have to much stuff under your for loop you cant increment your n and count inside of the for loop because it will increment for every value in for loop.

anonymous
 5 years ago
Best ResponseYou've already chosen the best response.0line 2 sets n=1 line 4 = if n>0 line 21 is the else clause for line 4  you will never get to line 22 your code looks like it might find six successive numbers of nuggets that you cannot buy (if that set exists) but you never do anything with that sixth number. well maybe not; your comparison at line 9 might not be working because you have your n = n+1 statement in the innermost for loop  it probably needs to be outside of all the for loops. put a print statement in there to see what it is doing with respect to a, b and c  then you can see if n is doing what you want it to... something like print 'a:',a,'b:',b,'c:',c,'n:',n in between lines 8 and 9 are you sure that there are six consecutive numbers that you cannot buy? i bet the maximum number of consecutive numbers that you cannot buy is 5. if you can find six consecutive numbers that you Can buy (x > x+5) and the theorem is right  whats the highest number you cannot buy?
Ask your own question
Sign UpFind more explanations on OpenStudy
Your question is ready. Sign up for free to start getting answers.
spraguer
(Moderator)
5
→ View Detailed Profile
is replying to Can someone tell me what button the professor is hitting...
23
 Teamwork 19 Teammate
 Problem Solving 19 Hero
 Engagement 19 Mad Hatter
 You have blocked this person.
 ✔ You're a fan Checking fan status...
Thanks for being so helpful in mathematics. If you are getting quality help, make sure you spread the word about OpenStudy.