Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 9/18/84; site rochester.UUCP Path: utzoo!watmath!clyde!bonnie!akgua!sdcsvax!dcdwest!ittvax!decvax!linus!philabs!cmcl2!seismo!rochester!amitabha From: amitabha@rochester.UUCP (Amitabha Mukhopadhyay) Newsgroups: net.puzzle,net.math Subject: Re: Solve 1 + 11 + 111 + 1111 +... Message-ID: <6465@rochester.UUCP> Date: Wed, 13-Feb-85 11:15:33 EST Article-I.D.: rocheste.6465 Posted: Wed Feb 13 11:15:33 1985 Date-Received: Sun, 17-Feb-85 05:06:22 EST Reply-To: amitabha@rochester.UUCP (Amitabha Mukhopadhyay(for Ballard)) Organization: U. of Rochester, CS Dept. Lines: 44 Xref: watmath net.puzzle:554 net.math:1821 In article <545@decwrl.UUCP> osman@sprite.DEC (Eric Osman) writes: >Subject: solve 1 + 11 + 111 . . . + n 1's > >Let n1 be the last number in the sequence, i.e. n 1's. > >The answer for a given n is 1 + 11 + 111 + . . . + n1 > > a(n) = (10*n1 - n) / 9 > >The way I solved it was to observe that the sum is a portion of an infinite >converging geometric series........ In what may be a simpler process, let s be the sum desired. Then resolving into powers of 10, s = 10**(n-1) + 2*10**(n-2) + .. + m*10**(n-m) + .. + n*1 Dividing s by 10, s/10 = 10**(n-2) + .. + (m-1)*10**(n-m) +..+ (n-1) + n/10 (s-s/10) is clearly a geometric series in 10 with a residue of -n/10. 0.9*s = 10**(n-1) + 10**(n-2) + .. + 10**(n-m) + .. + 1 - n/10 = (10**n - 1)/9 - n/10 or, s = (10**n - 1)/8.1 - n/9 Which can be simplified to Eric's format if we write 10**n - 1 = n1 * 9, where n1 is n 1's (111111.. n times). s = n1 * 10/9 - n/9 = (n1*10 - n)/9 >At this point, I smiled and went back to more important(?) hacking. ------------------------------------------------------------------------- Amitabha Mukerjee Here's to you and here's to me And I hope we never disagree, But if we do then to heck with YOU, And here's to ME! -------------------------------------------------------------------------