Explicit Sequence

Integral calculus: sequences

Complete Code

Download file: ExplicitSequence.pg

PG problem file

Explanation

DOCUMENT();

loadMacros('PGstandard.pl', 'PGML.pl', 'PGcourse.pl');

Preamble

These standard macros need to be loaded.
Context()->variables->are(n => 'Real');

$answer = Compute('(-1)^n / n!');
$answer->{test_points} = [ [1], [2], [3], [4], [5], [6] ];

Setup

The answer is a formula involving factorials that are only defined for positive integers. So set the test points to be positive integers to avoid errors when evaluating the answer.

For more explanation on test_points see Formula Test Points

BEGIN_PGML
Find a formula for [`n^{th}`] term of the sequence [`a_0 = 1`], [`a_1 = -1`].
[`a_2 = \frac{1}{2}`], [`a_3 = -\frac{1}{6}`], [`a_4 = \frac{1}{24}`],
[`a_5 = -\frac{1}{120}`], [`\ldots`].

[`a_n =`] [_]{$answer}{20}
END_PGML

Statement

This is the problem statement in PGML.
BEGIN_PGML_SOLUTION
Solution explanation goes here.
END_PGML_SOLUTION

ENDDOCUMENT();

Solution

A solution should be provided here.