FYI: we cannot execute "matlabpool open" on the labs. ;)
DON'T TALK WUDE
function y = euler005(x)
y=1;
for i=2:x
y=lcm(i,y);
end
end
Great problem!
What it does: it finds the maximum number of occurrences for each prime number smaller than x in the factorisations of the numbers 1:x (e.g., for x = 10, the maximum number of occurrences for 2 is 3, since 2*2*2 = 8). If the product of all prime factors taken to the power of their maximum # of occurrences is then taken, the smallest number that is divisible by 1:10 is obtained. So for x = 10: 2 * 2 * 2 * 3 * 3 * 5 * 7 = 2520.
nice
cool
This code works but the server is too slow...
Flip the main diagonal of a matrix
506 Solvers
Return elements unique to either input
550 Solvers
Compute a dot product of two vectors x and y
750 Solvers
248 Solvers
387 Solvers
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!