Jump to content

Featured Replies

How did you solve it?

 

I noticed a pattern in what each subsequent term was "leaving out", and figured out a formula for the sum of the first n terms, then used induction to see that it works as n goes to infinity. Is there another way?

1 hour ago, md65536 said:

How did you solve it?

Spoiler
// Compile:
// gcc math.cpp -o math
//
// Execute:
// ./math

#include <stdio.h>

int main( void ) {
 double accum = 0;
 for( int i = 2; i < 100000; i++ ) {
  //printf( "%c1/(%dx%d)\n", i==2 ? ' ' : '+', i-1, i );
  accum += 1.0 / ( (i-1)*i );
 }
 printf( "Sum %g\n", accum );
 return( 0 );
}

..for the first 100,000..

Quote

+1/(99994x99995)
+1/(99995x99996)
+1/(99996x99997)
+1/(99997x99998)
+1/(99998x99999)
Sum 0.999965

TODO: replace 'double' by a type from some arbitrary precision library.

https://en.wikipedia.org/wiki/List_of_C%2B%2B_multiple_precision_arithmetic_libraries

 

Edited by Sensei

  • Author
4 hours ago, md65536 said:

Is there another way?

Yes, there is. Here is a hint:

Spoiler

2023-04-30.png.4b0370de3188498cf71eb40faa5fbee9.png

See where it goes?

Please sign in to comment

You will be able to leave a comment after signing in

Sign In Now

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.