Computer: Space (or click) to go forward, q (or click the back button) to go back. Mobile: tab the screen to go forward, tap the back button to go back. If you don't understand any symbols (^, *, etc), logic, or something else about this project, ask about it in the comments. I had a paper with math logic on it as well, but I lost it and don't remember how I got to that. This could work with negatives, but you have to adjust the theory a little (a+1=b, a^2-b^2=|a+b|).