Two Plus Two Older Archives  

Go Back   Two Plus Two Older Archives > 2+2 Communities > Other Other Topics
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 03-29-2005, 12:43 PM
mostsmooth mostsmooth is offline
Senior Member
 
Join Date: Nov 2002
Location: AC
Posts: 153
Default somebody post a puzzle already

preferably a logic heavy puzzle as im not too good with any type of advanced math
thanks
work svcks
that is all
Reply With Quote
  #2  
Old 03-29-2005, 01:01 PM
beerbandit beerbandit is offline
Senior Member
 
Join Date: Feb 2004
Location: 13 deep at Moe\'s
Posts: 156
Default Re: somebody post a puzzle already


There are one thousand lockers and one thousand students in the school. The principal asks the first student to go to every locker and open it. Then he has the second student go to every second locker and close it. The third goes to every third locker and, if it is closed, he opens it, and if it is open, he closes it. The fourth student does this to every fourth locker, and so on. After the process is completed with the thousandth student, how many lockers are open?


cheers
Reply With Quote
  #3  
Old 03-29-2005, 01:10 PM
chaas4747 chaas4747 is offline
Senior Member
 
Join Date: Jan 2005
Location: Ask Bellucci, she\'s the one making the face
Posts: 1,113
Default Re: somebody post a puzzle already

Not going to come up with total answer, but here is how you do it in white

<font color="white">Number of perfect squares between 1 and 1000 </font>
Reply With Quote
  #4  
Old 03-29-2005, 01:14 PM
jason_t jason_t is offline
Senior Member
 
Join Date: Nov 2004
Location: Another downswing?
Posts: 2,274
Default Re: somebody post a puzzle already

Results in white below:
<font color="white">Label the lockers 1, 2, 3, etc. A locker will be open if and only if its label is has an odd number of divisors. Only the perfect squares have an odd number of divsors (every divisor of a non-square n is paired with a different divisor of n) so the only lockers that will be open are labeled with perfect squares. The answer is thus the number of perfect squares between 1 and 1000, inclusive.</font>
Reply With Quote
  #5  
Old 03-29-2005, 01:30 PM
mostsmooth mostsmooth is offline
Senior Member
 
Join Date: Nov 2002
Location: AC
Posts: 153
Default Re: somebody post a puzzle already

wouldnt that be 31? or is that too easy?
Reply With Quote
  #6  
Old 03-29-2005, 01:33 PM
DMBFan23 DMBFan23 is offline
Senior Member
 
Join Date: Jun 2004
Location: I don\'t want a large Farva
Posts: 417
Default Re: somebody post a puzzle already

<font class="small">Code:</font><hr /><pre> Dim i As Integer 'i will be the ith door that student n is currently on
Dim n As Integer 'n will be the student currently opening doors

n = 1
i = 1

Dim doorindex As Long


For n = 1 To 1000
For i = 1 To 1000
doorindex = i * n
If doorindex &lt;= 1000 Then

If wksht.Cells(n * i, 1) = "c" Then
'open it
wksht.Cells(n * i, 1) = "o"
Else
'close it
wksht.Cells(n * i, 1) = "c"
End If
Else
GoTo nextkid
End If
Next
nextkid:
Next </pre><hr />

gives 31 doors, all the squares.
Reply With Quote
  #7  
Old 03-29-2005, 01:53 PM
jason_t jason_t is offline
Senior Member
 
Join Date: Nov 2004
Location: Another downswing?
Posts: 2,274
Default Re: somebody post a puzzle already

Meh.
Reply With Quote
  #8  
Old 03-29-2005, 01:53 PM
spamuell spamuell is offline
Senior Member
 
Join Date: Oct 2003
Location: London, UK
Posts: 924
Default Re: somebody post a puzzle already

[ QUOTE ]
GoTo

[/ QUOTE ]

Boo.
Reply With Quote
  #9  
Old 03-29-2005, 01:56 PM
jason_t jason_t is offline
Senior Member
 
Join Date: Nov 2004
Location: Another downswing?
Posts: 2,274
Default Re: somebody post a puzzle already

[ QUOTE ]
[ QUOTE ]
GoTo

[/ QUOTE ]



Boo.

[/ QUOTE ]

Here, I agree. However:

Rubin, Frank. "'GOTO Considered Harmful' Considered Harmful" (letter to the editor), Communications of the ACM, vol. 30, no. 3 (March 1987), pp. 195-6.
Reply With Quote
  #10  
Old 03-29-2005, 02:01 PM
mmbt0ne mmbt0ne is offline
Senior Member
 
Join Date: Aug 2004
Location: Atlanta, GA
Posts: 700
Default Re: somebody post a puzzle already

Did you just bust out code for a logic problem? Doesn't that kind of defeat the purpose.

I agree with boo GoTo. That was 10th grade VB6 man, you're better than that.
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 02:38 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.