RosettaCodeData/Task/Padovan-sequence/Uiua/padovan-sequence.uiua
2026-04-30 12:34:36 -04:00

10 lines
564 B
Text
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

R ← ⍥(˜⊂+◌⊸⊣₃) ⊙1_1_1 -3
F ← ⊂1⁅÷1.045356793252533⍥(⊸×1.324717957244746)⊙1-1
M ← map"ABC" {"B" "C" "AB"}
N ← ⇌∧(⊂⇌°□˜getM)⊙""
L ← ⍥(˜⊂⍜°□N⊸⊣)⊙{"A"}-1
&pR 20 # First 20 terms using recurrence relationship.
&p⨬("no match"|"match")≍⊃R F 64 # Show that formula matches up to 64 terms.
&p L 10 # First ten terms of the L-system.
&p⨬("no match"|"match")≍⊃(R|≡◇⧻L) 32 # Show that lengths match recurrence up to 32 terms.