#!/usr/local/bin/perl proto A(Int \𝑚, Int \𝑛) { (state @)[𝑚][𝑛] //= {*} } multi A(0, Int \𝑛) { 𝑛 + 1 } multi A(1, Int \𝑛) { 𝑛 + 2 } multi A(2, Int \𝑛) { 3 + 2 * 𝑛 } multi A(3, Int \𝑛) { 5 + 8 * (2 ** 𝑛 - 1) } multi A(Int \𝑚, 0 ) { A(𝑚 - 1, 1) } multi A(Int \𝑚, Int \𝑛) { A(𝑚 - 1, A(𝑚, 𝑛 - 1)) } say A(4,1); say .chars, " digits starting with ", .substr(0,50), "..." given A(4,2);