Pell numbers: Difference between revisions

→‎{{header|J}}: bugfix (... my focus is far too narrow when I forget to double check against the english description)
(→‎{{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:
 
=={{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.
 
Line 128 ⟶ 127:
 
Continuing... the first ten rational approximations to √2 here would be:
<lang J> }.(%~ _1}. +//.@,:~) nextPell^:9(0 1)
1 01.6666675 01.7142864 01.70588241667 01.70731741379 01.70707141429 01.7071134142 01.70710641422 01.70710741421 01.70710741421
}.(%~ _1}. +//.@,:~) nextPell^:9(0 1x)
1 2r33r2 5r77r5 12r1717r12 29r4141r29 70r9999r70 169r239239r169 408r577577r408 985r13931393r985 2378r33633363r2378</lang>
 
The first ten pell primes are:
6,951

edits