Van Eck sequence: Difference between revisions
Put Algol W in the right place
(Added Algol W) |
(Put Algol W in the right place) |
||
Line 464:
<pre> 0 0 1 0 2 0 2 2 1 6
4 7 30 25 67 225 488 0 10 136</pre>
=={{header|APL}}==▼
{{works with|Dyalog APL}}▼
<lang APL>(10∘↑,[.5]¯10∘↑)(⊢,(⊃∘⌽∊¯1∘↓)∧(1↓⌽)⍳⊃∘⌽)⍣999⊢,0</lang>▼
{{out}}▼
<pre>0 0 1 0 2 0 2 2 1 6▼
4 7 30 25 67 225 488 0 10 136</pre>▼
=={{header|ALGOL W}}==
{{Trans|ALGOL 68}}
<lang algolw>begin % find elements of the Van Eck Sequence - first term is 0, following %
% terms are 0 if the previous was the first appearance of the element %
Line 511 ⟶ 505:
4 7 30 25 67 225 488 0 10 136
</pre>
▲=={{header|APL}}==
▲{{works with|Dyalog APL}}
▲<lang APL>(10∘↑,[.5]¯10∘↑)(⊢,(⊃∘⌽∊¯1∘↓)∧(1↓⌽)⍳⊃∘⌽)⍣999⊢,0</lang>
▲{{out}}
▲<pre>0 0 1 0 2 0 2 2 1 6
▲4 7 30 25 67 225 488 0 10 136</pre>
=={{header|AppleScript}}==
|