HP Forums
Evaluate an expression for given points - Printable Version

+- HP Forums (https://www.hpmuseum.org/forum)
+-- Forum: HP Calculators (and very old HP Computers) (/forum-3.html)
+--- Forum: HP Prime (/forum-5.html)
+--- Thread: Evaluate an expression for given points (/thread-14348.html)



Evaluate an expression for given points - blevita - 01-12-2020 09:28 AM

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


RE: Evaluate an expression for given points - Tyann - 01-12-2020 10:22 AM

(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.


RE: Evaluate an expression for given points - blevita - 01-12-2020 11:44 AM

Merci

Ca cest tres bien.


Worked perfectly


RE: Evaluate an expression for given points - Allen - 01-12-2020 08:25 PM

(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.


RE: Evaluate an expression for given points - CyberAngel - 01-13-2020 02:28 AM

(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