Term Rewriting System R:
[N, X, Y, X1, X2, Z]
terms(N) -> cons(recip(sqr(N)), nterms(s(N)))
terms(X) -> nterms(X)
sqr(0) -> 0
dbl(0) -> 0
dbl(s(X)) -> s(ns(ndbl(activate(X))))
dbl(X) -> ndbl(X)
first(0, X) -> nil
first(s(X), cons(Y, Z)) -> cons(Y, nfirst(activate(X), activate(Z)))
first(X1, X2) -> nfirst(X1, X2)
s(X) -> ns(X)
activate(nterms(X)) -> terms(X)
activate(ns(X)) -> s(X)
activate(ndbl(X)) -> dbl(X)
activate(nfirst(X1, X2)) -> first(X1, X2)
activate(X) -> X

Termination of R to be shown.

`   R`
`     ↳Dependency Pair Analysis`

R contains the following Dependency Pairs:

TERMS(N) -> SQR(N)
TERMS(N) -> S(N)
SQR(s(X)) -> SQR(activate(X))
SQR(s(X)) -> ACTIVATE(X)
SQR(s(X)) -> DBL(activate(X))
DBL(s(X)) -> S(ns(ndbl(activate(X))))
DBL(s(X)) -> ACTIVATE(X)
FIRST(s(X), cons(Y, Z)) -> ACTIVATE(X)
FIRST(s(X), cons(Y, Z)) -> ACTIVATE(Z)
ACTIVATE(nterms(X)) -> TERMS(X)
ACTIVATE(ns(X)) -> S(X)
ACTIVATE(ndbl(X)) -> DBL(X)
ACTIVATE(nfirst(X1, X2)) -> FIRST(X1, X2)

Furthermore, R contains one SCC.

`   R`
`     ↳DPs`
`       →DP Problem 1`
`         ↳Remaining Obligation(s)`

The following remains to be proven:
Dependency Pairs:

SQR(s(X)) -> DBL(activate(X))
FIRST(s(X), cons(Y, Z)) -> ACTIVATE(Z)
FIRST(s(X), cons(Y, Z)) -> ACTIVATE(X)
ACTIVATE(nfirst(X1, X2)) -> FIRST(X1, X2)
DBL(s(X)) -> ACTIVATE(X)
ACTIVATE(ndbl(X)) -> DBL(X)
ACTIVATE(nterms(X)) -> TERMS(X)
SQR(s(X)) -> ACTIVATE(X)
SQR(s(X)) -> SQR(activate(X))
TERMS(N) -> SQR(N)

Rules:

terms(N) -> cons(recip(sqr(N)), nterms(s(N)))
terms(X) -> nterms(X)
sqr(0) -> 0
dbl(0) -> 0
dbl(s(X)) -> s(ns(ndbl(activate(X))))
dbl(X) -> ndbl(X)
first(0, X) -> nil
first(s(X), cons(Y, Z)) -> cons(Y, nfirst(activate(X), activate(Z)))
first(X1, X2) -> nfirst(X1, X2)
s(X) -> ns(X)
activate(nterms(X)) -> terms(X)