I did not originally look to see exactly how far one could go. It looks like, IF one is careful in the important expression, you should be able to get to 3329020. I'd expect that the code I'd write that would solve this to go as far as 3329020 would employ an initial test to know if n is even or odd, changing the expression I'd write depending on the parity of n. Of course that branch would also increase the complexity, so raising the Cody score.
This appears to be true only for sequences of numbers starting from 1 and some combinations of these sequences.
it is exactly the right way to solve this one.
Could you please explain a bit about how the problem was converted to a polynomial function?
works for n up to 3329020
works for n up to 2642245, so it doesn't use the full potential of the uint64
isequal ignores the data type of the values in determining whether they are equal.
flintmax('double') = 2^53 < 15503197751395200
eps(15503197751395200) = 2
Big letters, small letters and a bit of luck.
Find all elements less than 0 or greater than 10 and replace them with NaN
Reverse the Words (not letters) of a String
Change the sign of even index entries of the reversed vector
Generate a NaN...on purpose
Convert a Cell Array into an Array
Simpsons's rule (but not Homer Simpson)
Counting the Grand Primes
Euclidean distance from a point to a polynomial
Euclidean inter-point distance matrix
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