Problem 59217. List lunar triangular numbers without duplication
Triangular numbers—which are the subject of Cody Problems 5, 291, 44289, 44732, 45833, 55680, 55695, and 55705—are the sums of consecutive integers. For example, the 10th triangular number is the sum of the numbers 1 to 10, or 55.
Lunar addition, which is the subject of Cody Problem 44785, involves taking the largest digit in the sum. For example, 1+3 = 3, 3+6 = 6, 13+51 = 53, and 428+620 = 628.
Write a function to compute the nth lunar triangular number without duplicating any terms. For example, the 10th lunar triangular number is 1+2+3+4+5+6+7+8+9+10 = 19. The 11th lunar triangular number is also 19, but because it is a duplicate, it would not be listed in this sequence. Express the answer as a character string.
Solution Stats
Solution Comments
Show commentsProblem Recent Solvers4
Suggested Problems
-
Return the 3n+1 sequence for n
8348 Solvers
-
1406 Solvers
-
Matrix with different incremental runs
127 Solvers
-
Generate a vector like 1,2,2,3,3,3,4,4,4,4
11966 Solvers
-
Given a matrix, swap the 2nd & 3rd columns
1139 Solvers
More from this Author291
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!