Prime triangle: Difference between revisions

(Dialects of BASIC moved to the BASIC section.)
(→‎{{header|jq}}: simplify)
Line 927:
end
else .count += 1
| .icount =as .$count - 1
| untilreduce range(.i$count >- 1; $n - 21; 2) #as $n-2i (.;
.arrang[.$i] as $ai
| if .canFollow[$ad-1][$ai-1]
then .countarrang as= swap(.arrang; $counti; $count-1)
| ptrs(.ires; as$n; $icount)
| .arrang = swap(.arrang; $i; $count-1)
| ptrs(.res; $n; $count) # updates .res but also .count and .i
| .count = $count # restore .count
| .i = $i # restore .i
| .arrang = swap(.arrang; $i; $count-1) # restore .arrang
else .
end )
| .i += 2
)
end;
 
Line 996 ⟶ 990:
[1,1,1,1,1,2,4,7,24,80,216,648,1304,3392,13808,59448,155464,480728,1588162]
</pre>
 
 
=={{header|Julia}}==
2,442

edits