Using the following definition of the 666 function for this problem: f(n)=sin('nnn')-cos(n*n*n), write a function that returns the first N integer zeros of the 666 function, formatted as 'nnn'.
For example:
sixsixsix(1) = should return 666
sixsixsix(7) should return 666 151515 181818 272727 424242 636363 666666
Note 1: Consider a 'zero' to occur when f(n)<1e-8
Note 2: The sin and cosine functions must be in degrees, not radians.
Solution Stats
Problem Comments
Solution Comments
Show commentsProblem Recent Solvers26
Suggested Problems
-
Select every other element of a vector
37209 Solvers
-
Return a list sorted by number of occurrences
2901 Solvers
-
Replace NaNs with the number that appears to its left in the row.
3071 Solvers
-
Back to basics 8 - Matrix Diagonals
973 Solvers
-
Cumulative product of a vector
302 Solvers
More from this Author9
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
This problem wants us to find the first n integer roots of the 666 function. It took me a while to understand this problem. The first integer root is at sind(666)-cosd(6^3).
The notation 'nnn' is shorthand for "concatenate three copies of n". As I understand the problem, the roots of the function (i.e., the values of n at which the function is zero) are 6, 15, 18, 27, etc. However, we are to output 'nnn': 666, 151515, 181818, 272727, etc.