Sometimes the hardest part of a workout is finding exactly how many reps you just completed. There is one workout in particular that one of my clients, Kent, did this week that looked like this:

Conventional Deadlift @ 115# x 21,18,15,12,9,6,3

Wall Balls @ 16# x 3,6,9,12,15,18,21

The workout goes like this: 21 deadlifts, 3 wall balls, 18 deadlifts, 6 wall balls, and so on until the end where you do 3 deadlifts and 21 wall balls. After the workout we were trying to figure out how many total reps of each exercise were performed.

Apparently there is some math we can do to easily figure this out. Kent sent me a link to Arithmetic Sequence and I figured we could learn a little more about software at the same time.

The following code(in C#) will calculate the total reps for us using the formulas from Arithmetic Sequence. You’ll notice that I specify the start, 3, the constant difference is specified by **diff=3;**

I’ve also put a **7** in there,

**for(var n=1;n<=7;n++)**

since we need to know the number of iterations to perform.

Running the code in Snippet Compiler gives us the following result:

In an effort to make this easier I whipped up an html page that allows you to perform the calcs yourself. Check it out.