Hi, DP. You have created a nice problem here: well done. Could you please clarify/check/amend one detail though. In the Problem Statement it stipulates the sum must be that "less than" maxval. So if maxval=1, then the series would have no terms (hence sum=0); alternatively, if it had one term, then the sum (1²=1) would be "less than or equal to" maxval, as implied in the Test Suite. Thanks, DIV
Thanks for the clarification!
This submission has evidently been copied from 'somewhere', because it is _identical_ to Solution 1499384 (submitted on 21 Apr 2018 by J. S. Kowontan). It would be good professional practice to _at least_ acknowledge the source. Moreover I don't see the point of submitting a verbatim copy of somebody else's solution; it does not bring any credit. —DIV
Finding Perfect Squares
Count from 0 to N^M in base N.
Back to basics 14 - Keywords
Return 'on' or 'off'
Find the treasures in MATLAB Central and discover how the community can help you!
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list:
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Contact your local office