MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn moreOpportunities for recent engineering grads.

Apply Today**New to MATLAB?**

Given the number x, y must be the summation of all integers from 1 to 2^x. For instance if x=2 then y must be 1+2+3+4=10.

2365 correct solutions
1306 incorrect solutions

Last solution submitted on Mar 06, 2015

4 players like this problem

1 player likes this solution

1 Comment

Dimitris Kaliakmanis
on 15 Oct 2013

How this solution is possible?

1 Comment

Kuifeng
on 31 Mar 2012

This solution can accept arrays of integers as x input

2 players like this solution

1 Comment

David Young
on 9 Feb 2012

A good example of a solution that does well on Cody's size measure, but which I wouldn't use for serious purposes.

2 Comments