Problem 61147. Determine whether a number is a repfigit number
A sequence of numbers is constructed from a number x with the following steps:
- List the n digits of x.
- Compute the (
)st term as the sum of the digits of x.
- Compute the remaining terms as the sum of the previous n terms.
A repfigit (or Keith) number is a starting number greater than 9 that reappears in the sequence. For example, starting with 14, one gets 1, 4, 5, 9, 14. Starting with 197, one gets 1, 9, 7, 17, 33, 57, 107, 197. Thus, both 14 and 197 are repfigit numbers.
Write a function to determine whether the input number (given as a character string) is a repfigit number.
Solution Stats
Problem Comments
-
3 Comments
Christian Schröder
on 3 Jan 2026 at 9:56
Cool problem, Chris! FYI, tests 8 and 9 appear to be identical.
ChrisR
on 3 Jan 2026 at 14:05
Thanks Christian. Best wishes for 2026!
Christian Schröder
16 hours and 35 minutes ago
Thank you, and the same to you!
Solution Comments
Show commentsProblem Recent Solvers2
Suggested Problems
More from this Author319
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!