home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #27 / NN_1992_27.iso / spool / sci / math / 15237 < prev    next >
Encoding:
Text File  |  1992-11-19  |  1020 b   |  28 lines

  1. Newsgroups: sci.math
  2. Path: sparky!uunet!zaphod.mps.ohio-state.edu!darwin.sura.net!haven.umd.edu!news.umbc.edu!math9.math.umbc.edu!rouben
  3. From: rouben@math9.math.umbc.edu (Rouben Rostamian)
  4. Subject: Re:    1+1/2+1/3+1/4+...+1/n
  5. Message-ID: <1992Nov19.164239.14756@umbc3.umbc.edu>
  6. Sender: newspost@umbc3.umbc.edu (News posting account)
  7. Organization: University of Maryland Baltimore Campus
  8. References: <92324.132329K3032E2@ALIJKU11.BITNET>
  9. Date: Thu, 19 Nov 1992 16:42:39 GMT
  10. Lines: 16
  11.  
  12. In article <92324.132329K3032E2@ALIJKU11.BITNET> Mutter Christoph Johannes <K3032E2@ALIJKU11.BITNET> writes:
  13. >I've a problem. I have to calculate the sum 1+1/2+1/3+1/4+...+1/n.
  14. >The result should be 100. But my computer is far too slow, to solve this
  15. >problem. I need the index n when the sum > 100.0
  16. >And that exactly.  Has anyone calculated this? (Perhaps on a CRAY|) ?
  17.  
  18. Here is a program that you may find useful.  It has been completely
  19. debugged on my personal cray.
  20.  
  21. sum = 0
  22. for k=1 to 10^44
  23.    sum = sum + 1/k
  24. end
  25. print sum
  26.  
  27. :-)
  28.