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 <A HREF=Consecutive-Number-Word-Problems.lesson>consecutive word problems lesson</A>, always use <CODE>x</CODE> for the number they ask you to find out. In this case, it is the smaller number. The \"next number\" after <CODE>x</CODE> is <CODE>x+1</CODE>, \n\n\n"; print "The $count consecutive numbers are: <CODE>x"; my $i; for( $i = 1; $i < $count; $i++ ) { print ",x+$i"; } print "</CODE>\n\n\n"; print "The equation is: <CODE>x"; for( $i = 1; $i < $count; $i++ ) { print " + x+$i"; } print " = $sum</CODE>\n\n\n"; print "Rearranging: <CODE>x" . (" + x" x ($count-1)); for( $i = 1; $i < $count; $i++ ) { print " + $i"; } print " = $sum</CODE>\n\n\n"; my $z = $count*($count-1)/2; my $s = $sum - $z; my $x = ($sum-$z)/$count; print "Simplifying: <CODE>$count*x + $z = $sum</CODE> Subtract $z from both sides: <CODE>$count*x + $z - $z = $sum - $z</CODE> <CODE>$count*x = $sum - $z</CODE> {{{x = ($sum-$z)/$count}}} {{{x = ($s)/$count}}} x = $x This is your answer! <B>The \"first consecutive number\" is equal to $x</B>. Please see <A HREF=Consecutive-Number-Word-Problems.lesson>consecutive word problems lesson</A> to learn more. "; $number = $x; ==section output number ==section check number=2 count=2 sum=5