A problem where one must be at least a little careful about floating point arithmetic. It might have been interesting if one of the test cases were x=1e5 or larger. Even more interesting if the execution time were a factor in the "score". These factors might impact how the problem would be best solved.
@ Doug Hall, I have solved all the problems in the series. However, I have not received the badge and the associated scores on completion of the series. Can you please look into this?
function y = euler006(x)
y = x*(x^2-1)*(3*x+2)/12;
Adding comment for testing badges!!
Is there a more compact way to calculate the sum of squares? (like how I calculated the square of sums)
My solution is failing,please help me out
1. You used the wrong formula for the sum of the squares of the the first x natural numbers. 2. Also, your implementation of the square of the sum of the first x natural number is incorrect. 3. Finally, You are to subtract (1) from (2) not the other way round.
How can I view the solution?
can someone explain what the value and size of a correct answer means.
I think simpler is impossible. The only thing is that it needs 8 operations...
For loops, not cool!
William, Why are for loops not cool?
Are all the three given point in the same line?
Basics: 'Find the eigenvalues of given matrix
03 - Matrix Variables 1
07 - Common functions and indexing 6
Poker Series 04: isFlush
Is this is a Tic Tac Toe X Win?
Find perfect placement of non-rotating dominoes (easier)
Project Euler: Problem 10, Sum of Primes
Project Euler: Problem 5, Smallest multiple
Find the treasures in MATLAB Central and discover how the community can help you!
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list:
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Contact your local office