Jump to content
BrainDen.com - Brain Teasers
  • 0


Guest
 Share

Question

We have 100 lamps.Each one connected to its very own on of switch(wich is a press button.You push it and the lamp opens.Push it again and the lamp closes)

We have 100 frogs.The first frog jumps and open all switches.The second frog jumps at a length of 2 switches.Wich mean that it closes the 2nd the 4th the 6th the 8th and so on...

The thrid frog makes a jump of 3 switches long.Wich mean that he closes the 3rd switch, opens the 6th closes the 9th, opens the 12th and so on.

After 100 frogs,wich lamps will remain open?

Link to comment
Share on other sites

20 answers to this question

Recommended Posts

  • 0

You have reason, but I don't want to solve it so soon. The general solution for N lamps is int(sqr(N)).

Int?Int doesn't chop of the decimal points? for example if we had Int(10/3) = 3 right?The square root of 100 doesn't have decimal points

Edited by Tsopi
Link to comment
Share on other sites

  • 0

Light 1 is ON

Light 2 is OFF

Light 3 is OFF

Light 4 is ON

Light 5 is OFF

Light 6 is OFF

Light 7 is OFF

Light 8 is OFF

Light 9 is ON

Light 10 is OFF

Light 11 is OFF

Light 12 is OFF

Light 13 is OFF

Light 14 is OFF

Light 15 is OFF

Light 16 is ON

Light 17 is OFF

Light 18 is OFF

Light 19 is OFF

Light 20 is OFF

Light 21 is OFF

Light 22 is OFF

Light 23 is OFF

Light 24 is OFF

Light 25 is ON

Light 26 is OFF

Light 27 is OFF

Light 28 is OFF

Light 29 is OFF

Light 30 is OFF

Light 31 is OFF

Light 32 is OFF

Light 33 is OFF

Light 34 is OFF

Light 35 is OFF

Light 36 is ON

Light 37 is OFF

Light 38 is OFF

Light 39 is OFF

Light 40 is OFF

Light 41 is OFF

Light 42 is OFF

Light 43 is OFF

Light 44 is OFF

Light 45 is OFF

Light 46 is OFF

Light 47 is OFF

Light 48 is OFF

Light 49 is ON

Light 50 is OFF

Light 51 is OFF

Light 52 is OFF

Light 53 is OFF

Light 54 is OFF

Light 55 is OFF

Light 56 is OFF

Light 57 is OFF

Light 58 is OFF

Light 59 is OFF

Light 60 is OFF

Light 61 is OFF

Light 62 is OFF

Light 63 is OFF

Light 64 is ON

Light 65 is OFF

Light 66 is OFF

Light 67 is OFF

Light 68 is OFF

Light 69 is OFF

Light 70 is OFF

Light 71 is OFF

Light 72 is OFF

Light 73 is OFF

Light 74 is OFF

Light 75 is OFF

Light 76 is OFF

Light 77 is OFF

Light 78 is OFF

Light 79 is OFF

Light 80 is OFF

Light 81 is ON

Light 82 is OFF

Light 83 is OFF

Light 84 is OFF

Light 85 is OFF

Light 86 is OFF

Light 87 is OFF

Light 88 is OFF

Light 89 is OFF

Light 90 is OFF

Light 91 is OFF

Light 92 is OFF

Light 93 is OFF

Light 94 is OFF

Light 95 is OFF

Light 96 is OFF

Light 97 is OFF

Light 98 is OFF

Light 99 is OFF

Light 100 is ON

Total ON: 10

Link to comment
Share on other sites

  • 0

Int?Int doesn't chop of the decimal points? for example if we had Int(10/3) = 3 right?The square root of 100 doesn't have decimal points

Right. So, if the square root of 100 is 10, there are 10 lamps on. If there are 543 lamps, there are int(sqr(543)) = int(23.302) = 23 lamps on.

Link to comment
Share on other sites

  • 0

Nice...can you explain how you found it?I knew the riddle but didn't remember how to solve it.(this is one of the reasons i posted this thread XD )

Edited by Tsopi
Link to comment
Share on other sites

  • 0

Right. So, if the square root of 100 is 10, there are 10 lamps on. If there are 543 lamps, there are int(sqr(543)) = int(23.302) = 23 lamps on.

Yes, but the question is which are open...

Link to comment
Share on other sites

  • 0

Sorry, I don't speak english. I'll try.

The lamps on have an even number of divisors. The only numbers which have an even number of divisors are the perfect squares. So, the lamps on are the perfect squares.

B))

Link to comment
Share on other sites

  • 0

Sorry, I don't speak english. I'll try.

The lamps on have an even number of divisors. The only numbers which have an even number of divisors are the perfect squares. So, the lamps on are the perfect squares.

B))

this is right

Link to comment
Share on other sites

  • 0

Sorry, I don't speak english. I'll try.

The lamps on have an even number of divisors. The only numbers which have an even number of divisors are the perfect squares. So, the lamps on are the perfect squares. B))

I believe what you mean to say is that the only numbers which have an ODD number of divisors are the perfect squares.

Link to comment
Share on other sites

  • 0

well, i got

lamps 1, 5, 6, 7, 11, 12, 13, 17, 18, 19, 23, 24, 25, 29, 30, 31, 35, 36, 37, 41, 42, 43, 47, 48, 49, 53, 54, 55, 59, 60, 61, 65, 66, 67, 71, 72, 73, 77, 78, 79, 83, 84, 85, 89, 90, 91, 95, 96, 97 are on

sorry wrong..look at the others..

Link to comment
Share on other sites

  • 0

i still don't get it. why only perfect squares?

The number of divisors of X is obtained by decomposing X into its prime divisors. If X = a ^ u * b ^ v * c ^ w, with a, b and c prime, the number of divisors is N = (u +1) * (v +1) * (w +1). N is odd only if u, v and w are even. When all the exponents to those that are high dividers are even numbers, the number is a square.

Edited by :-)
Link to comment
Share on other sites

  • 0

The number of divisors of X is obtained by decomposing X into its prime divisors. If X = a ^ u * b ^ v * c ^ w, with a, b and c prime, the number of divisors is N = (u +1) * (v +1) * (w +1). N is odd only if u, v and w are even. When all the exponents to those that are high dividers are even numbers, the number is a square.

Assume you're a lamp with a number n. Then only the frogs whose number divides n will jump on you (1,..., n).

And since you flip-flop between on/off and start initially off, your hopes to remain on are that an odd number of frogs jump on you.

Every divisor d multiplied together with his unique pair r gives n.

So if all divisors could be paired with a different divisor, this would yield an even number of divisors which means - you're off.

If a divisor could not find a pair except himself, this would yield an odd number of divisors - which happens only to square numbers (n=d*d).

So if you're born a square, you're on :D

P.S. been watching too much Doctor Who lately and probably got a "Who"-flu or something.

Edited by araver
Link to comment
Share on other sites

  • 0

Assume you're a lamp with a number n. Then only the frogs whose number divides n will jump on you (1,..., n).

And since you flip-flop between on/off and start initially off, your hopes to remain on are that an odd number of frogs jump on you.

Every divisor d multiplied together with his unique pair r gives n.

So if all divisors could be paired with a different divisor, this would yield an even number of divisors which means - you're off.

If a divisor could not find a pair except himself, this would yield an odd number of divisors - which happens only to square numbers (n=d*d).

So if you're born a square, you're on :D

P.S. been watching too much Doctor Who lately and probably got a "Who"-flu or something.

It's a very good explanation. It's easy to understand and does not use mathematical concepts. I like it. :thumbsup:

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...