Jump to content

Motzkin numbers: Difference between revisions

(added Arturo)
Line 717:
fun isPrime = logic by int n
if n <= 1 do return false end
for int i = 2; i <= [int] !sqrt(n); ++i
if n % i == 0 do return false end
end
return true
end
fun format = text by var n, int max do return " " * (max - length([text] !n)) + n end
fun motzkin = List by int n
List m = int[].with(n)
226

edits

Cookies help us deliver our services. By using our services, you agree to our use of cookies.