HP Forums

Full Version: Evaluate an expression for given points
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi there

I would like to evaluate the following expression for even and odd n‘s

One solution could be to type in n=1 then, n=2 and so on but this is time consuming. Is there a way to directly define the numbers where to evaluate the expression?

I have tried with n=[0 1] then the calculator crashed...


Thank you.
Regards
Blevita
(01-12-2020 09:28 AM)blevita Wrote: [ -> ]Hi there

I would like to evaluate the following expression for even and odd n‘s

One solution could be to type in n=1 then, n=2 and so on but this is time consuming. Is there a way to directly define the numbers where to evaluate the expression?

I have tried with n=[0 1] then the calculator crashed...


Thank you.
Regards
Blevita

Bonjour
Utilisez une liste {1,2,...} à la place de n.

Hello
Use a list {1,2,...} instead of n.
Merci

Ca cest tres bien.


Worked perfectly
(01-12-2020 09:28 AM)blevita Wrote: [ -> ]I would like to evaluate [an] expression for even and odd n‘s...

Is it practical to calculate f(x)=2/(n*pi) and multiply f(x) by (n MOD 2)?
This should return f(x) for odd n and 0 for even n.

it's possible to do the same thing if you don't have the MOD function by cleverly using (-1)^n.
(01-12-2020 08:25 PM)Allen Wrote: [ -> ]
(01-12-2020 09:28 AM)blevita Wrote: [ -> ]I would like to evaluate [an] expression for even and odd n‘s...

Is it practical to calculate f(x)=2/(n*pi) and multiply f(x) by (n MOD 2)?
This should return f(x) for odd n and 0 for even n.

it's possible to do the same thing if you don't have the MOD function by cleverly using (-1)^n.
irem
Reference URL's