Tag Info

New answers tagged


It depends on how raw you want to go. Here is an approach that maintains the symbolic character of the formalism: ClearAll[convertToS, convertFromS, add]; convertToS[0] := 0; convertToS[n_] := Last[ComposeList[ConstantArray[S, n], 0]]; convertFromS[chain_] := Count[chain, S, Infinity, Heads -> True]; add[a_, 0] := a; add[0, a_] := a; add[chain1_, ...


According to this Wiki article, the successor function is the function with S(1) = 2 and S(2) = 3.. this can be implemented in several ways, perhaps the simplest of which is s[n_] := n + 1 Hence s[2] returns 3 and s[10] returns 11. The add function is handled automatically since s[n]+m is 1+n+m. The product is similar since, for instance, s[n] m is ...

Top 50 recent answers are included