##DESCRIPTION ##KEYWORDS('') ## ##ENDDESCRIPTION DOCUMENT(); # This should be the first executable line in the problem. loadMacros( "PG.pl", "PGbasicmacros.pl", "PGchoicemacros.pl", "PGanswermacros.pl", "PGgraphmacros.pl" ); TEXT(beginproblem()); $showPartialCorrectAnswers = 1; $a = random(3,5,1); $b = random(-5,10); $c = random(1,3,1); if ($a == 3) {$ans = $c**2 - ($c+1)**2 + ($c+2)**2 - ($c+3)**2 + 4*$b;} if ($a == 4) {$ans = $c**2 - ($c+1)**2 + ($c+2)**2 - ($c+3)**2 + ($c+4)**2 + 5*$b;} if ($a == 5) {$ans = $c**2 - ($c+1)**2 + ($c+2)**2 - ($c+3)**2 + ($c+4)**2 - ($c+5)**2 + 6*$b;} BEGIN_TEXT Evaluate the sum: \[ \sum_{k=0}^{$a}{((-1)^k (k+$c)^2+$b)} \] \{ans_rule(20)\} END_TEXT ANS(num_cmp($ans, mode=>"arith")); ENDDOCUMENT(); # This should be the last executable line in the problem.