Hurrah for math functions that will most likely be of no use at all.
PHP Code:
public function arithSeq(term, firstterm, d) {
return firstterm + ( ( term - 1 ) * ( d ) );
}
public function geomSeq(term, firstterm, r) {
return ( firstterm ) * ( ( r ) ^ ( term - 1 ) );
}
public function arithSeries(term, firstterm, d) {
temp.termn = arithSeq(term, firstterm, d);
return ( term / 2 ) * ( firstterm + temp.termn );
}
public function geomSeries(term, firstterm, r) {
return ( firstterm - ( firstterm * ( r ^ term ) ) ) / ( 1 - r );
}
(I was bored)