Advertisement
Guest User

Untitled

a guest
Oct 31st, 2014
146
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.73 KB | None | 0 0
  1. count = 0
  2. limit = 15
  3. storage = []
  4. x = 1
  5. y = 1
  6.  
  7. for x in range(limit + 1):
  8. for y in range(limit + 1):
  9. x += 1
  10. y += 1
  11. n = x*y/(x+y)
  12. condition = x*y%(x+y)
  13.  
  14. if (condition == 0 and x<y and y<limit):
  15. count += 1
  16. storage.append(x)
  17. storage.append(y)
  18. storage.append(n)
  19.  
  20. print (storage)
  21. print (count)
  22.  
  23. count = 0
  24. limit = 15
  25. storage = []
  26. x = 1
  27. y = 1
  28.  
  29. for x in range(1,limit + 1):
  30. for y in range(1,limit + 1):
  31. n = x*y/(x+y)
  32. condition = x*y%(x+y)
  33.  
  34. if (condition == 0 and x<y and y<=limit):
  35. count += 1
  36. storage.append(x)
  37. storage.append(y)
  38. storage.append(n)
  39.  
  40. print (storage)
  41. print (count)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement