Problem 53120. Compute the Sequence of the Day
A sequence starts with 1 and 2, and each subsequent term is the sum of the digits of the product of the previous two terms. As a result, the third term is 2, the fourth is 4, and the fifth is 8.
Write a function to compute the nth term of the sequence.
Solution Stats
Problem Comments
-
3 Comments
goc3
on 28 Apr 2022
This is a good problem. James would be proud of your test suite.
ChrisR
on 7 May 2022
Thanks goc3!
Lincoln Poon
on 3 Oct 2022
Very nice problem. And a very elegant series:)
Solution Comments
Show commentsProblem Recent Solvers22
Suggested Problems
-
Select every other element of a vector
32968 Solvers
-
8893 Solvers
-
Replace NaNs with the number that appears to its left in the row.
2976 Solvers
-
144 Solvers
-
Longest run of consecutive numbers
5588 Solvers
More from this Author279
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!