Hello Grep

I think what you need is to study the following equations. They do provide general solutions to the sort of problems you've identified:

For all integer values of :

Check them out for various values of .

The first one gives:

... and so on.

The second one is easier:

... and so on.

Does that help?

Grandad