What is the first digit after the decimal in
n = 1 ∑ 1 5 n n 1 ?
This section requires Javascript.
You are seeing this because something didn't load right. We suggest you, (a) try
refreshing the page, (b) enabling javascript if it is disabled on your browser and,
finally, (c)
loading the
non-javascript version of this page
. We're sorry about the hassle.
1 2 3 4 |
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 |
|
Answer: 6
Python one-liner -
1 |
|
Simple standard approach.
While the summation seems to be challenging when done by hand, its corresponding code is incredibly short.
Below is a code in C.
#include <stdio.h>
#include <math.h>
double function(int x)
{
return(1.0/pow((double)x, pow((double)x, 0.5))) ;
}
int main(void)
{
double sum = 0.0 ;
int x ;
for(x = 1; x <= 15; x++)
sum += function(x) ;
printf("%lf", sum) ;
return 0 ;
}
When the program is compiled and run, the output will be
1.637996
So the first digit after the decimal is 6 .
Python 3.4
1 2 3 4 5 6 |
|
Problem Loading...
Note Loading...
Set Loading...
Here's a solution written in python 2.x