RosettaCodeData/Task/Van-Eck-sequence/Uiua/van-eck-sequence.uiua

8 lines
324 B
Text
Raw Permalink Normal View History

2026-02-01 16:33:20 -08:00
# Generate Van Eck sequence.
F ← (
◡<⊙⊙◌⊃(⋅⧻|⊸˜⨂)°⊂. # Check where/if first digit already appeared.
⊂⨬(⋅⋅0|⋅+₁) # If new, prepend zero, else last index it was in.
)
⇌⍥F999 [0] # Generate 1000 terms and reverse.
⊃(&p↙¯)(&p↙∘)10 # Print first and last 10 terms.