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 Solvers119
Suggested Problems
-
Project Euler: Problem 9, Pythagorean numbers
810 Solvers
-
438 Solvers
-
3205 Solvers
-
Given a square and a circle, please decide whether the square covers more area.
635 Solvers
-
Convert from Fahrenheit to Celsius
16945 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!