A number theory problem by Anubhav Jain

Number Theory Level pending

At a party, everyone shook hands with everybody else. There were 66 handshakes. How many people were at the party?


The answer is 12.

This section requires Javascript.
You are seeing this because something didn't load right. We suggest you, (a) try refreshing the page, (b) enabling javascript if it is disabled on your browser and, finally, (c) loading the non-javascript version of this page . We're sorry about the hassle.

1 solution

Brock Brown
Dec 26, 2014
1
2
3
4
5
6
7
8
def handshakes(p):
    return (p * (p - 1)) / float(2)
people = 2
test = handshakes(people)
while test != 66:
    people += 1
    test = handshakes(people)
print "Number of people:", people

0 pending reports

×

Problem Loading...

Note Loading...

Set Loading...