Could someone help me and write an algorithm to add 2 Cantor expansions. The algorithm to get a decimal number to cantor expansion is:(adsbygoogle = window.adsbygoogle || []).push({});

procedure decimal-to-cantor(x: positive integer)

n := 1

y := x fy is a temporary variable used so that

this procedure won't destroy the original value of x.g

while y 6= 0

begin

an := y mod (n+1)

y := (y-an )/(n+1)

n := n + 1

end

f The expansion for x will be an n! + an−1 (n-1)! + : : : + a22! + a1 . g

Now i just need to figure out how to add 2 cantor expansion numbers together to get one. Someone help please!

**Physics Forums | Science Articles, Homework Help, Discussion**

Join Physics Forums Today!

The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

# Homework Help: Cantor Expansion Addition algorithm?

**Physics Forums | Science Articles, Homework Help, Discussion**