Pell numbers: Difference between revisions
Content added Content deleted
Thundergnat (talk | contribs) (→{{header|J}}: incorrect. √2 not 1/√2) |
(→{{header|J}}: bugfix (... my focus is far too narrow when I forget to double check against the english description)) |
||
Line 95: | Line 95: | ||
=={{header|J}}== |
=={{header|J}}== |
||
{{incorrect|J|√2 is 1.41421... not 0.707107... Seems to be calculating the recipricol 1/√2, which is interesting, but not what the task asks for.}} |
|||
As detailed in the task description, there's a variety of ways to compute these values. |
As detailed in the task description, there's a variety of ways to compute these values. |
||
Line 128: | Line 127: | ||
Continuing... the first ten rational approximations to √2 here would be: |
Continuing... the first ten rational approximations to √2 here would be: |
||
<lang J> }.(% _1}. +//.@,:~) nextPell^:9(0 1) |
<lang J> }.(%~ _1}. +//.@,:~) nextPell^:9(0 1) |
||
1 |
1 1.5 1.4 1.41667 1.41379 1.41429 1.4142 1.41422 1.41421 1.41421 |
||
}.(% _1}. +//.@,:~) nextPell^:9(0 1x) |
}.(%~ _1}. +//.@,:~) nextPell^:9(0 1x) |
||
1 |
1 3r2 7r5 17r12 41r29 99r70 239r169 577r408 1393r985 3363r2378</lang> |
||
The first ten pell primes are: |
The first ten pell primes are: |