Get Help

Turn on suggestions

Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

- Community
- :
- PTC Mathcad
- :
- PTC Mathcad
- :
- Re: How to correct the Pell(n) function ? (for n =...

Options

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page

Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Notify Moderator

12-23-2014
07:52 AM

12-23-2014
07:52 AM

Hello Everyone,

How to correct the Pell(n) function ? ( for n = 181)

Thanks in advance for your time and help.

Regards.

Solved! Go to Solution.

Labels:

1 ACCEPTED SOLUTION

Accepted Solutions

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Notify Moderator

01-04-2015
07:19 AM

01-04-2015
07:19 AM

For some N (like 2,5,10) m is just 1 (second element of C is already greater than the root of N) and so your calculation of the rearranged vector c fails. Either include another if-statement to cope with that case (then c<--C) or do it completely different like in the attached.

14 REPLIES 14

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Notify Moderator

12-24-2014
10:24 AM

12-24-2014
10:24 AM

Re: How to correct the Pell(n) function ? (for n = 181)

Looking at Numerical Recipes, I think you need to add a correction factor in for when w[0,1 is zero.

Stuart

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Notify Moderator

12-24-2014
10:56 PM

12-24-2014
10:56 PM

Re: How to correct the Pell(n) function ? (for n = 181)

I greatly appreciate your help, Stuart.

With :

http://www.jakebakermaths.org.uk/maths/jshtmlpellsolverbigintegerv10.html

Best Regards.

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Notify Moderator

12-25-2014
07:22 PM

12-25-2014
07:22 PM

Re: How to correct the Pell(n) function ? (for n = 181)

Unfortunately, I'm Mathcadless for a week or so, but you can define your function as follows.

Rename my function to PellA.

Define

Pell(n):=p <-PellA(n, infinity)

stack (p[1, p[2)

thenPell(P181).

Stuart

Highlighted
##

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Notify Moderator

01-03-2015
11:56 PM

01-03-2015
11:56 PM

Re: How to correct the Pell(n) function ? (for n = 181)

Hello Everyone again,

Now I need help with correcting the Pell_Test(N) function, the above. ("This array index is invalid for this array")

Thanks in advance for your time and help.

Best Regards.

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Notify Moderator

01-04-2015
07:19 AM

01-04-2015
07:19 AM

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Notify Moderator

01-04-2015
08:02 AM

01-04-2015
08:02 AM

Re: How to correct the Pell(n) function ? (for n = 181)

I greatly appreciate your help. The answer is very neat . Many, many thanks, Werner.

By the way, I need help with how to type "the thin equal sign" (the green circle) in Mathcad 14.

Best Regards.

Message was edited by: Loi Le

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Notify Moderator

01-04-2015
10:06 AM

01-04-2015
10:06 AM

Re: How to correct the Pell(n) function ? (for n = 181)

By the way, I need help with how to type "the thin equal sign" (the green circle) in Mathcad 14.

Same way as the * and the +. If you create a math region and you type Ctrl-Shift-K (cursor gets red as in a text region) you can use literally any character in a variable name. Pressing Ctrl-Shift-K again brings you back to normal mode. That way you can use characters in variable names which normally would be taken as operators. The sam way you can also insert some spaces instead of using the underline character as you had done.

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Notify Moderator

01-04-2015
11:06 AM

01-04-2015
11:06 AM

Re: How to correct the Pell(n) function ? (for n = 181)

I got it. . Many, many, many thanks, Werner. .

Best Regards.

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Notify Moderator

01-05-2015
12:06 AM

01-05-2015
12:06 AM

Re: How to correct the Pell(n) function ? (for n = 181)

I guess the Pell_Test(N) function need to adjust a little bit :

after adjusting a little bit :

And while I am learning about match( ) , submatrix( ) function, I adjust the function a little bit :

Thanks again.

Best Regards.

Message was edited by: Loi Le