The reason that is does nothing is that you are stuck in an infinite loop. The inner loop ( while summ<=1500 ) runs until k=12, then exits to the outer loop. Then you get this sequence happening over and over:
while k<=12 % true (k=12)
while summ<=1500 % false (skip to end)
...
end
end % k=12 because the inner loop was skipped
You don't really need the outer loop - you're aiming for a finite sum, so the inner loop will definitely terminate.
Another thing to think about: the terms in s are 1,2,4,8,16, ... Is that what the question asks for?