Problem 252. Project Euler: Problem 16, Sums of Digits of Powers of Two
Solution Stats
Problem Comments
-
1 Comment
added a test case to make it a wee bit harder
Solution Comments
-
2 Comments
function y = pow2_sumofdigits(x)
number = sym(2^x);
n = char(number);
y = 0;
for i = 1:length(n)
y = y + str2double(n(i));
end
end
this code gives exact results on my mechine but not work in cody show error
Error: License checkout failed.
License Manager Error -5
Cannot find a license for Symbolic_Toolbox.
Troubleshoot this issue by visiting:
http://www.mathworks.com/support/lme/R2013a/5
Diagnostic Information:
Feature: Symbolic_Toolbox
License path: 13501@10.206.97.41:13501@10.10.207.33:/tmp/matlabpref/.matlab/R2013a_licenses:/opt/mlsedu/matlab/R2013a/licenses/license.dat:/opt/mlsedu/matlab/R2013a/licenses
Licensing error: -5,0.
please help me ...........
Symbolic_Toolbox can't run on Cody.
Problem Recent Solvers120
Suggested Problems
-
Back to basics 4 - Search Path
356 Solvers
-
Solve the set of simultaneous linear equations
363 Solvers
-
Vectorize the digits of an Integer
304 Solvers
-
199 Solvers
-
Find last zero for each column
398 Solvers
More from this Author56
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!