The numbers 2 and 7 are called lucky numbers, an integer containing only the digits 2 and 7 is also called lucky number. The problem is, given a sequence of lucky numbers arranged in the following order:
Lucky_num=[ 2, 7, 22, 27, 72, 77, 222, 227, 272, 277, 722, 727, 772, 777,.......]
Write a function that takes n as a parameter, we expect the output to be the nth lucky number
Eg:
n=8
-> output: 227
note: with this plus version you have to find the Nth number with extremely large N, for example 1e9, return n in string form
n=1e9
->ouput: "77277722772727722722777777272"
Solution Stats
Problem Comments
2 Comments
Solution Comments
Show comments
Loading...
Problem Recent Solvers25
Suggested Problems
-
25 Solvers
More from this Author4
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
Since the test suite values for 61014 are apparently incorrect, I suspect the same applies here. In addition, many of the values n in the test suite exceed flintmax.
the test case has been updated