Computer Science 15-100, Summer 2009
Class Notes:  More Loops Practice


More Loops Practice

  1. Discover the following the math facts:
    1. 1/x + 1/x2 + 1/x3 + ...          =  ?    answer:  1/(x-1)
    2. 1 + 1/x + 1/x2 + 1/x3 +...     = ?     answer:  x/(x-1)
    3. 1 - 1/x + 1/x2 - 1/x3 +...       = ?     answer:  x/(x+1)
    4. 1 + 2/x + 3/x2 + 4/x3 +...     = ?     answer:   [x/(x-1)]2 
    5. 1 - 2/x + 3/x2 - 4/x3 +...       = ?     answer:   [x/(x+1)]2
    6. round(phin/sqrt(5))             = ?     answer:   fib(n)  [ n is a positive integer, phi = (1+sqrt(5))/2 ]
    7. The nth positive integer z such that either (5z2+4) or (5z2-4) is a perfect square = ?   answer:  fib(n)
    8. The sum of the reciprocals of the divisors of any perfect number must add up to:  ?.   answer:  2 

carpe diem   -   carpe diem   -   carpe diem   -   carpe diem   -   carpe diem   -   carpe diem   -   carpe diem   -   carpe diem   -   carpe diem