Infinite Gift

From “Passion for Mathematics” by Clifford Pickover

The diagram is for a puzzle called ‘Infinite Gift’ which appears in Pickover’s “Passion for Mathematics”. The puzzle asks to compute a volume of infinitely long solid formed by stacking up infinitely many cubes. The bottom-most 1st cube has a side of 1.0, and each subsequent i-th cube has a side 1/sqrt(i). So the series has an overall formula:

sum( (1/i)^(3/2), i, 1, +infinity)

The Basel problem asks to compute a volume of series which looks remarkably similar:

sum( (1/i)^2, i, 1, infinity)

and it has a beautiful solution found by Euler: (pi^2)/6. Thus it would be very interesting to find out if the series for this problem has an analytic solution. The following is the small C program to compute the volume by numerical approximation. It uses gmp library designed for calculations using long numbers. The compilation command is:

gcc -w -std=c99 infinite_gift.c -lm

and the resultant value is:

I found the infinite series for this problem is an example of Riemann zeta function. Some Riemann’s zeta functions have closed forms like (pi^2)/6 but many do not, and apparently this is an example of such a problem.

// ----------------------------------------------------------------------------------------------
#include <unistd.h>
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <gmp.h>
int main(int argc, char ** argv){
     mpf_t md;
     mpf_t mi;
     mpf_t mi_s;
     for (int i = 1; i < 1000000; i++) {
         mpf_set_d(mi, 1.0/((double)i));
         mpf_mul(mi_s, mi, mi);
         mpf_mul(mi, mi_s, mi);
         mpf_add(md, md, mi);
     gmp_printf("%.Ff\n", md);
// ----------------------------------------------------------------------------------------------

~ by Monsi.Terdex on November 23, 2012.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Normal Boy

Nothing out of the ordinary

Data Engineering Blog

Compare different philosophies, approaches and tools for Analytics.

%d bloggers like this: