# Solver Sum of consecutive word problems solver

Algebra ->  Algebra  -> Customizable Word Problem Solvers  -> Numbers -> Solver Sum of consecutive word problems solver      Log On

 Ad: Over 600 Algebra Word Problems at edhelper.com Ad: Algebrator™ solves your algebra problems and provides step-by-step explanations! Ad: Algebra Solved!™: algebra software solves algebra homework problems with step-by-step help!

 Word Problems: Numbers, consecutive odd/even, digits Solvers Lessons Answers archive Quiz In Depth

### Source code of 'Sum of consecutive word problems solver'

This Solver (Sum of consecutive word problems solver) was created by by ichudov(499)  : View Source, Show, Put on YOUR site
About ichudov: I am not a paid tutor, I am the owner of this web site.

 ==section input Sum of *[input count=2] consecutive numbers is equal to *[input sum=5]. Find the smaller number. Good examples of inputs are (2,5) or (3, 12). ==section solution perl print "As explained in the consecutive word problems lesson, always use x for the number they ask you to find out. In this case, it is the smaller number. The \"next number\" after x is x+1, \n\n\n"; print "The \$count consecutive numbers are: x"; my \$i; for( \$i = 1; \$i < \$count; \$i++ ) { print ",x+\$i"; } print "\n\n\n"; print "The equation is: x"; for( \$i = 1; \$i < \$count; \$i++ ) { print " + x+\$i"; } print " = \$sum\n\n\n"; print "Rearranging: x" . (" + x" x (\$count-1)); for( \$i = 1; \$i < \$count; \$i++ ) { print " + \$i"; } print " = \$sum\n\n\n"; my \$z = \$count*(\$count-1)/2; my \$s = \$sum - \$z; my \$x = (\$sum-\$z)/\$count; print "Simplifying: \$count*x + \$z = \$sum Subtract \$z from both sides: \$count*x + \$z - \$z = \$sum - \$z \$count*x = \$sum - \$z {{{x = (\$sum-\$z)/\$count}}} {{{x = (\$s)/\$count}}} x = \$x This is your answer! The \"first consecutive number\" is equal to \$x. Please see consecutive word problems lesson to learn more. "; \$number = \$x; ==section output number ==section check number=2 count=2 sum=5