Calkin-Wilf sequence: Difference between revisions
→{{header|J}}: simplify
(→{{header|J}}: simplify) |
|||
Line 1,224:
cw_next_term=: [: % +:@<. + -.
ccf =: compute_continued_fraction=:
molcf =: make_odd_length_continued_fraction=: (}: , 1 ,~ <:@{:)^:(0 -: 2 | #)
Line 1,244 ⟶ 1,231:
index_cw_term=: #.@|.@(# 1 0 $~ #)@molcf@ccf
</syntaxhighlight>
=={{header|jq}}==
'''Adapted from [[#Wren|Wren]]'''
|