As soon as once more, I dive into the murky waters of arithmetic for this month’s Train. The problem is to code the Sequence That Has No Identify (STHNN), which converges on the worth 5e.
From the unique put up, Determine 1 reveals the sequence because it’s written in mathematical hieroglyphics. The duty is to transform these cryptic symbols into C code, with this system spitting out the worth of e, Euler’s quantity.
Determine 1. The scary mathematical Sequence That Has No Identify.
For my answer I exploit two capabilities: factorial() and dice().
The factorial() perform I stole from an earlier Lesson, which I hinted at within the Train put up. The dice() perform returns the argument handed cubed. I may use the pow() perform, however simply determined as an alternative to multiply the handed worth thrice, as proven beneath.
2026_06-Train.c
#embrace <stdio.h>
lengthy factorial(lengthy f)
{
if( f==1 )
return(f);
else
return(f * factorial(f-1));
}
lengthy dice(lengthy c)
{
return( c*c*c );
}
int major()
{
int x;
float e = 0.0;
for( x=1; x<50; x++ )
e += (float)dice(x)/factorial(x);
printf("%fn",e/5.0);
return 0;
}
The major() perform makes use of a for loop to calculate the worth of variable e, which is initialized to zero when the variable is said:
float e = 0.0;
Within the for loop, variable e is elevated every iteration by the worth of x cubed divided by x factorial. It’s a easy expression that represents the STHNN. I set the higher restrict on variable x to 50 as bigger values overflow however 50 nonetheless ends in an approximation of e that works.
As a result of the STHNN ends in 5e, the end result output is split by 5.0, which ends up in e:
2.718282
I hope that your answer met with success.

