All about flooble | fun stuff | Get a free chatterbox | Free JavaScript | Avatars    
perplexus dot info

Home > Numbers
Some Even and Odd Crossed Difference (Posted on 2023-11-03) Difficulty: 2 of 5
Let M = sum of the cubes of the first 2024 odd numbers
and N = sum of the cubes of the first 2023 even numbers.

Find M-N

See The Solution Submitted by K Sengupta    
Rating: 5.0000 (1 votes)

Comments: ( Back to comment list | You must be logged in to post comments.)
Solution Algebraic solution Comment 3 of 3 |
The sum of the first n cubes:  1^3 + 2^3 + ... n^3 = n^2(n+1)^2/4
To get the sum of the first n even cubes, just multiply by 8 = 2^3
     2^3 + 4^3 + ... + (2n)^3    = 2*n^2(n+1)^2
To get the sum of the first n odd cubes start with the sum of all cubes from 1 to 2n and subtract off the evens.

(2n)^2((2n)+1)^2/4 - 2*n^2(n+1)^2
(4n^2)(4n^2 + 4n + 1)/4 - 2*n^2(n^2 + 2n + 1)
(4n^4 + 4n^3 + n^2) - (2n^4 + 4^3 + 2n^2)
2n^4 - n^2
n^2(2n^2 - 1)  <--  sum of first n odd cubes

Let n = 2023
Sum of first (n+1) odd cubes minus first n even cubes:
(n+1)^2(2(n+1)^2 - 1) - 2*n^2(n+1)^2
(n+1)^2 * [(2(n+1)^2 - 1) - 2*n^2]
(n+1)^2 * (2n^2 + 4n + 1 - 2n^2)
(n+1)^2 * (4n + 1)
4n^3 + 9n^2 + 6n + 1

For n = 2023:  33153589568

------  verified  with program -----
ans = 0
for n in range(1,4048):
    ans += (-1)**(n+1) * n**3
    
print(ans)
Output:  33153589568

  Posted by Larry on 2023-11-03 10:19:07
Please log in:
Login:
Password:
Remember me:
Sign up! | Forgot password


Search:
Search body:
Forums (1)
Newest Problems
Random Problem
FAQ | About This Site
Site Statistics
New Comments (12)
Unsolved Problems
Top Rated Problems
This month's top
Most Commented On

Chatterbox:
Copyright © 2002 - 2024 by Animus Pactum Consulting. All rights reserved. Privacy Information