RosettaCodeData/Task/Padovan-sequence/Uiua/padovan-sequence.uiua

11 lines
564 B
Text
Raw Permalink Normal View History

2026-04-30 12:34:36 -04:00
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.