Problem 53990. Classify product/digit-sum sequences
Cody Problem 53120 involved a sequence in which a term is computed by multiplying the previous two terms and adding the digits of the product. In that problem the first two terms of the sequence were 1 and 2. The next four terms were 2, 4, 8, and 5.
What happens if the first two terms are changed? It turns out that these product/digit-sum sequences can be sorted into five groups. For reasons that will likely be apparent to those who solved Cody Problem 53120, the sequence there (and others like it) is assigned the number 163. The other four types of sequence are assigned the numbers 1, 9, 26, and 62.
Write a function to classify the product/digit-sum sequences given the first two terms a and b. To encourage solvers to find the pattern, loops are banned, and to allow for large inputs, a and b are specified as strings.
Solution Stats
Problem Comments
-
2 Comments
Rafael S.T. Vieira
on 26 Nov 2022
I didn't find a key, but a predominance between the five lists: 9 is the most powerful. 4 or 5 tests are enough, but some have made matrices with more than 25 possible combinations.
Rafael S.T. Vieira
on 26 Nov 2022
Tip FYI: If the sum of the digits of a number is divisible by 3, then the number is also divisible by 3, and the same rule exists for 9. All numbers have similar laws, it seems. A number divisible by 5 ends with 0 or 5, and so on...
Solution Comments
Show commentsGroup

Sequences & Series V
- 16 Problems
- 5 Finishers
- Solve a nonlinear difference equation
- Iterate the sum of divisors and totient
- Sum the elements in rows of the Levine triangle
- Find the smallest integer m such that n divides m!
- Identify Ruth-Aaron numbers
- Find numbers in the Popular Computing Z-sequence
- Find the nth nude number
- Determine whether a number is a fibodiv number
- List modest numbers up to n
- List the vile numbers
- List the dopey numbers
- Compute the Sequence of the Day
- Classify product/digit-sum sequences
- Count unique orderings of vertices of a polygon
- Count the ways to draw non-intersecting chords between points on a circle
- Fill a rectangle with 1x1 and 2x2 tiles
Problem Recent Solvers11
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!