new here, found this fun problem through google.

i+n was definitely the hardest one! remembering that the loop condition is only false when negative helped =)