Changes

Jump to navigation Jump to search
757 bytes added ,  10:49, 4 August 2016
no edit summary
Line 7: Line 7:     
1. Given a number n, find all roots from 1 to n of a given number N.
 
1. Given a number n, find all roots from 1 to n of a given number N.
 +
===Answer===
 +
nrootsofn:=(1..n)√n;
    
2. Add these up.
 
2. Add these up.
 +
===Answer===
 +
nrootsofn:=(1..n)√n;
 +
SUM(nrootsofn(29))
   −
3. Find the sum of 1 to n for all even numbers from 1 to 100.  
+
3. Find the sum of 1 to n for all even numbers from 1 to 100.
4. Find the factorial of reciprocals of a series of numbers from 1 to a large numbers and see how it compares to the value of e.  
+
===Answer===
 +
EVENS(1..100).$$(SUM)
 +
 +
4. Find the factorial of reciprocals of a series of numbers from 1 to a large numbers and see how it compares to the value of e.
 +
===Answer===
 +
[https://en.wikipedia.org/wiki/E_(mathematical_constant) e] is defined as:
 +
<img src=https://wikimedia.org/api/rest_v1/media/math/render/svg/4ecf44cf7290248f810619067256c209975ad8e1>
 +
 
 +
 
 +
FACTORIAL(0)+Σ(SERIESOF("1/x!",100)) or SUM(SERIESOF("1/x!",100,0)) give the result as 2.7182818284590455 which is quite close to e value of 2.71828182845904523536028747135266249775724709369995... (sequence A001113 in OEIS).
 +
 
 +
Σ(SERIESOF("1/x!",100))
 +
 
 +
( 1 to 100 only) is missing the original 1, and hence can be written as Σ(SERIESOF("1/x!",100,0))
 +
 
 +
∑(0..100@"1/x!")
 +
 
 +
also works
 +
 
 +
 
 +
SUM((0..100).$("1/x!")) is another answer.  
    
5. Create 3x4x5x6 array and fill with numbers 1 to 100
 
5. Create 3x4x5x6 array and fill with numbers 1 to 100
writer
5,435

edits

Navigation menu