A community for students.

Here's the question you clicked on:

55 members online
  • 0 replying
  • 0 viewing


  • 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
  1. anonymous
    • 5 years ago
    Best Response
    You've already chosen the best response.
    Medals 0

    First 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.

  2. anonymous
    • 5 years ago
    Best Response
    You've already chosen the best response.
    Medals 0

    line 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?

  3. Not the answer you are looking for?
    Search for more explanations.

    • Attachments:

Ask your own question

Sign Up
Find more explanations on OpenStudy
Privacy Policy

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...


  • Teamwork 19 Teammate
  • Problem Solving 19 Hero
  • 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.

This is the testimonial you wrote.
You haven't written a testimonial for Owlfred.