Results 1 to 4 of 4

Math Help - Strange equation

  1. #1
    Newbie
    Joined
    Sep 2005
    Posts
    2

    Strange equation

    I have come across this equation in a puzzle and I don't even know what it is, never mind the answer. Can any one help me, please?
    Here it is: -

    sum = 0
    Do n = 123 To 321 Step 3
    sum = sum + n
    Loop n
    Display sum
    Follow Math Help Forum on Facebook and Google+

  2. #2
    Senior Member
    Joined
    Jun 2005
    Posts
    295
    Awards
    1
    It's asking for the sum 123 + 126 + 129 + ... + 312.
    Follow Math Help Forum on Facebook and Google+

  3. #3
    Newbie
    Joined
    Sep 2005
    Posts
    2

    Strange equation

    Thank you for your help. When I'm faced with equations like that I think my mind just shuts down.
    Follow Math Help Forum on Facebook and Google+

  4. #4
    Gamigin
    Guest
    This is fairly simple actually:

    There are 67 terms in the sequence: floor((321-123)/3) + 1 = 67
    The sequence starts at 123
    The sequence ends at 321: 3 * floor((321-123)/3) + 123
    The average term is (123 + 321) / 2 = 222
    The total is going to be average term * number of terms = 222 * 67 = 14874

    I've verified this total with a small piece of Java code that doesn't take the above shortcut:

    Code:
    		long sum = 0;
    		for (long test = 123; test <= 321; test += 3) {
    			sum += test;
    		}
    		System.out.println("sum = " + sum);
    Follow Math Help Forum on Facebook and Google+

Similar Math Help Forum Discussions

  1. Strange equation
    Posted in the Math Puzzles Forum
    Replies: 6
    Last Post: January 22nd 2011, 10:28 AM
  2. Strange equation
    Posted in the Differential Equations Forum
    Replies: 2
    Last Post: January 4th 2011, 03:23 PM
  3. Strange equation
    Posted in the Differential Equations Forum
    Replies: 3
    Last Post: May 24th 2010, 04:52 PM
  4. strange differntial equation
    Posted in the Differential Equations Forum
    Replies: 6
    Last Post: February 6th 2010, 12:33 AM
  5. Strange Differental Equation Pls Help
    Posted in the Differential Equations Forum
    Replies: 1
    Last Post: January 13th 2010, 01:03 PM

Search Tags


/mathhelpforum @mathhelpforum